[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

checking command to parse /usr/bin/nm -B output from gcc object... faile

From: Martin Liška
Subject: checking command to parse /usr/bin/nm -B output from gcc object... failed
Date: Fri, 29 Nov 2019 12:11:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2


nm -B detection fails to be detected with -flto and -fno-common CFLAGS:

configure:6307: checking command to parse /usr/bin/nm -B output from gcc object
configure:6460: gcc -c -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong 
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection 
-Werror=return-type -g -fno-common -flto  conftest.c >&5
configure:6463: $? = 0
configure:6467: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ 
]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed 
'/ __gnu_lto/d' \> conftest.nm
configure:6470: $? = 0
configure:6536: gcc -o conftest -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong 
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection 
-Werror=return-type -g -fno-common -flto  -O2 -Wall -D_FORTIFY_SOURCE=2 
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables 
-fstack-clash-protection -Werror=return-type -g -fno-common -flto conftest.c 
conftstm.o >&5
conftest.c:18:12: error: variable 'nm_test_var' redeclared as function
   18 | extern int nm_test_var();
      |            ^
conftest.c:4:6: note: previously declared here
    4 |    relocations are performed -- see ld's documentation on 
pseudo-relocs.  */
      |      ^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: error: 
lto-wrapper failed
collect2: error: ld returned 1 exit status
configure:6539: $? = 1

As seen, I bet problem is in conftstm.o file (for which I can't see how it's 
created). Probably the file is missing
declaration of nm_test_var and so that it's implicitly deduced to be int 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]