On 2011-02-22 20:23, Jung-uk Kim wrote:
Since binutils 2.17.50 import, WITH_CTF=1& buildworld on amd64 stops
like this:
...
cc -m32 -march=i686 -mmmx -msse -msse2 -mfancy-math-387 -DCOMPAT_32BIT
-isystem /usr/obj/usr/src/lib32/usr/include/
-L/usr/obj/usr/src/lib32/usr/lib32
-B/usr/obj/usr/src/lib32/usr/lib32 -fpic -DPIC -O2 -pipe
-fno-omit-frame-pointer -I/usr/src/lib/librt/../libc/include
-I/usr/src/lib/librt -fexceptions -Winline -Wall -g -std=gnu99
-fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k
-Wno-uninitialized -Wno-pointer-sign -c /usr/src/lib/librt/aio.c -o
aio.So
ctfconvert -L VERSION aio.o
...
BFD: aio.So: invalid SHT_GROUP entry
BFD: aio.So: invalid SHT_GROUP entry
BFD: aio.So: no group info for section .text.__i686.get_pc_thunk.cx
BFD: aio.So: no group info for section .text.__i686.get_pc_thunk.bx
BFD: aio.So: unknown [0] section `' in group [__i686.get_pc_thunk.cx]
BFD: aio.So: unknown [0] section `' in group [__i686.get_pc_thunk.bx]
nm: aio.So: File format not recognized
...
Google found NetBSD has a similar looking PR but it is not exactly the
same:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=42986
What I gather from that bug report is that apparently ctfconvert can
corrupt object files with debug info, if you do not pass -g to it.
There is some logic in bsd.lib.mk to add '-g' to CTFFLAGS, if
DEBUG_FLAGS contains '-g', but in lib/librt/Makefile you can see:
...
CFLAGS+=-Winline -Wall -g
...
It looks like the -g flag is not detected, so ctfconvert is run without
-g, and it corrupts the .So file. I have no clue yet why this suddenly
appears after upgrading to binutils 2.17.50, but it is likely due to a
slightly different output format.
In any case, just removing the -g from CFLAGS in lib/librt/Makefile made
the build32 stage complete successfully for me, and since that is the
lsat stage of the amd64 build, I assume the rest will be OK too.
For now, I propose to commit the attached diff, and then we try to find
out why:
1) ctfconvert does not get -g passed when it is needed
2) ctfconvert corrupts .o files when -g is not passed :)
Index: lib/librt/Makefile
===================================================================
--- lib/librt/Makefile (revision 218951)
+++ lib/librt/Makefile (working copy)
@@ -6,7 +6,7 @@
.ifndef NO_THREAD_STACK_UNWIND
CFLAGS+=-fexceptions
.endif
-CFLAGS+=-Winline -Wall -g
+CFLAGS+=-Winline -Wall
DPADD= ${LIBPTHREAD}
LDADD= -lpthread
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"