site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mutt/1.5.18 (2008-05-17) In the new Link Time Optimization support for darwin in current FSF gcc trunk, we have run into one lto testcase that passes under linux with binutils but fails for darwin's linker. The reduced testcase is... [MacPro:~/lto_bug] howarth% cat 20081222_0.h int x(); [MacPro:~/lto_bug] howarth% cat 20081222_1.c #include "20081222_0.h" /* Actually, call "x" "INT_X", and make it hidden. */ extern __typeof (x) x __asm__ ("INT_x") __attribute__ (( __visibility__ ("hidden"))); int x () { return 7; } /* Make an externally-visible symbol "X" that's an alias for INT_x. */ extern __typeof (x) EXT_x __asm__ ("x") __attribute__ (( __alias__ ("INT_x"))); This fails to compile under darwin with the error... [MacPro:~/lto_bug] howarth% gcc -O0 -c -o c_lto_20081222_1.o 20081222_1.c 20081222_1.c:16: error: only weak aliases are supported in this configuration whereas if the last line of 20081222_1.c is changed to... __attribute__ (( weak, __alias__ ("INT_x"))); the error becomes... [MacPro:~/lto_bug] howarth% gcc -O0 -c -o c_lto_20081222_1.o 20081222_1.c 20081222_1.c:16: error: ‘EXT_x’ aliased to undefined symbol ‘INT_x’ Both variations of the testcase are accepted by gcc under linux. My question is whether the second form of the testcase is undefined behavior or if it is a valid form and I should file a radar on this issue? Thanks in advance for any advice. Jack _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com