https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120513

--- Comment #9 from Greg Chandler <chandleg at wizardsworks dot org> ---
I've done a lot of digging through the config script and am seeing some absurd
behaviour...  The first of the "not detected" files is sys/file.h, and the
conftest.c created for that is this:

/tmp/gcc-14.2.0/gcc.build.lnx/libiberty# cat conftest.c
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _GNU_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
/* end confdefs.h.  */
#include <sys/file.h>

Hitting that with the compiler yeilds this bizzare mess:
/tmp/gcc-14.2.0/gcc.build.lnx/libiberty# alpha-linux-gnu-gcc 1.c
cc1: warning: '-fstack-protector' not supported for this target
/opt/tools/bin/../lib/gcc/alpha-linux-gnu/14.2.0/../../../../alpha-linux-gnu/bin/ld:
/opt/usr/lib/crt1.o: in function `__start':
/tmp/glibc-2.41/csu/../sysdeps/alpha/start.S:52:(.text+0x14): undefined
reference to `main'
collect2: error: ld returned 1 exit status


/tmp/glibc-2.41 does not exist, and has not existed on this machine since it
was built a couple of months ago.  I am at a loss as to how it's referencing
line 52 of a file that has not been there for more than 30 days, and does not
try normally....


So, it's not that the files aren't being found, it's that the compiler is
calling the linker which is doing this.  But ONLY on these specifc files...



With this everything works, so it _has_ to be something with the defines:
/tmp/gcc-14.2.0/gcc.build.lnx/libiberty# cat 2.c
#include <sys/file.h>

int main ()
  {
  }


/tmp/gcc-14.2.0/gcc.build.lnx/libiberty# alpha-linux-gnu-gcc 2.c -o
test.cross.alpha-2c
cc1: warning: '-fstack-protector' not supported for this target

/tmp/gcc-14.2.0/gcc.build.lnx/libiberty# file test.cross.alpha-2c
test.cross.alpha-2c: ELF 64-bit LSB pie executable, Alpha (unofficial), version
1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, with debug_info,
not stripped

Reply via email to