In a updated binutils git tree: $ CC="gcc" CFLAGS="-march=native -mtune=native -O2 -pipe -fstack-protector-all" ./configure && make -j10 && make -j10 check <snip> Running /home/xake/devel/testcases/binutils/ld/testsuite/ld-elfvsb/elfvsb.exp ... FAIL: common hidden symbol FAIL: weak hidden symbol DSO last FAIL: weak hidden symbol DSO first However if I try build it with -fstack-protector or -fno-stack-protector all checks passes fine. The tests fails because the link command does not link with anything, but -fstack-protector-all needs the final binary to be linked against libc, else it will not find all its symbols. If I add -fno-stack-protector to the CFLAGS in elfvsb.exp it also passes. However I do not know how to write the code for runtest to make this change in a portable and reliable way. config/default.exp has a logic to determine if it uses gcc, should I do a similar check for elfvsb.exp and add -fno-stack-protector to the end of CFLAGS if gcc is used??
Created attachment 4815 [details] demonstration patch
Hi Peter, Well you could modify the default_ld_simple_link in the linker testsuite library so that it adds the missing symbols. (See the uploaded patch). But this introduces other failures in the testsuite since it pollutes the symbol table. You could export the logic from default_ld_simple_link for detecting a gcc compiler and use it in the elfvsb.exp script to add the missing symbols, or to turn off stack protection. Cheers Nick
Yes, there are many CFLAGS that perturb the testsuite