Bug 97169

Summary: Dummy 'chflags' function causes failures for autoconf scripts
Product: [Retired] Red Hat Raw Hide Reporter: Valdis Kletnieks <valdis.kletnieks>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.3.2-51 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-17 16:44:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Valdis Kletnieks 2003-06-11 04:28:20 UTC
Description of problem:
The dummy 'chflags' function in glibc causes issues for autoconf configure
scripts, which treat the fact that there is a chflags() function present as
meaning that there is a usable chflags() function present.  Searching the
glibc-hackers mailing list, this seems to be related to some check-abi work
done a while ago (see
http://sources.redhat.com/ml/libc-hacker/2003-03/msg00052.html  for an example)
A "consistent" ABI is all fine and good, but this doesn't seem to be the way to
get there.

Version-Release number of selected component (if applicable):
glibc-2.3.2-48

How reproducible:
Compile cample program, see that there is no error.

Steps to Reproduce:
1.
2.
3.
    
Actual results:
Program links, causing './configure' to assume there is a usable chflags,
causing later compile errors because there's no actual support for it.
In particular, there's no UF_IMMUTABLE to be found in /usr/include....

Expected results:
A link error, so configure doesn't assume software is present.

Additional info:
A stripped-down version of a standard autoconf-generated test:
AC_CHECK_FUNCS(chflags)

[~]2 cat test-chflag.c
char chflags(); /* actual proto doesn't matter */

char (*f) () = chflags;

int main() {

  return f != chflags;
;
 return 0;
}
[~]2 gcc -o test-chflag test-chflag.c
/tmp/cclUXrNr.o(.text+0x16): In function `main':
: warning: chflags is not implemented and will always fail
[~]2 echo $?
0

so configure then defines HAVE_CHFLAGS and all sorts of hilarity ensues
when code that's inside a #ifdef HAVE_CHFLAGS gets compiled.

Comment 1 Jakub Jelinek 2003-06-17 16:44:31 UTC
dummy chflags is in glibc for years. The problem is that <gnu/stubs.h> header
was empty because of Makefile dependency rewrite.