Userland build fails with GCC48

Frank Wille <[email protected]>
Newsgroups gmane.os.netbsd.ports.m68k
Organization Privates Internet Ostwestfalen/Lippe
Message-ID <[email protected]>
Hi!

I fear there are still some problems with PIC code to resolve, before we
can switch m68k to GCC48. A normal build works, but as soon as you add
MKDEBUG=YES or DBG=-g, some 16-bit PC-relative references are getting out
of range.

For example while building libgcc_s.so:

---8<---
#     build  libgcc_s/libgcc_s.so.1.0
rm -f libgcc_s.so.1.0
/home/frank/netbsd/current/src/objamiga/tooldir.NetBSD-6.1.5-amd64/bin/m68k--netbsdelf-gcc -nodefaultlibs -Wl,-x -shared -Wl,-soname,libgcc_s.so.1 -Wl,--warn-shared-textrel -Wl,-Map=libgcc_s.so.1.map   --sysroot=/home/frank/netbsd/current/src/objamiga/destdir.amiga -nodefaultlibs -Wl,--version-script=/home/frank/netbsd/current/src/objamiga/external/gpl3/gcc/lib/libgcc/libgcc_s/libgcc.map  -o libgcc_s.so.1.0  -Wl,-rpath,/lib  -L=/lib  -Wl,--whole-archive libgcc_s_pic.a  -Wl,--no-whole-archive  
libgcc_s_pic.a(_float.pico):(.text+0x8): relocation truncated to fit: R_68K_PC16 against symbol `$_exception_handler' defined in .text section in libgcc_s_pic.a(_floatex.pico)
libgcc_s_pic.a(_float.pico):(.text+0x18): relocation truncated to fit: R_68K_PC16 against symbol `$_exception_handler' defined in .text section in libgcc_s_pic.a(_floatex.pico)
---8<---

There was a 16-bit bra in the PICJUMP macro, which I fixed like this:

--- lb1sf68.S   1 Mar 2014 08:41:47 -0000       1.1.1.1
+++ lb1sf68.S   26 Jan 2015 11:05:16 -0000
@@ -215,7 +215,7 @@
        lea     \addr-.-8,a0
        jmp     pc@(a0)
 #else
-       bra     \addr
+       jbra    \addr
 #endif
        .endm


But there are more problems. Now it hangs here:

---8<---
#   compile  lib/sqlite3.pico
/home/frank/netbsd/current/src/objamiga/tooldir.NetBSD-6.1.5-amd64/bin/m68k--netbsdelf-gcc -g -DNDEBUG   -std=gnu99    -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  -Wno-traditional  -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wno-uninitialized -Wno-maybe-uninitialized -Werror -Wno-shadow -Wno-unused     -DHAVE_GMTIME_R=1  -DHAVE_INTTYPES_H=1  -DHAVE_LOCALTIME_R=1  -DHAVE_READLINE=1  -DHAVE_STDINT_H=1  -DHAVE_STRERROR_R=1  -DHAVE_USLEEP=1  -DSQLITE_ENABLE_COLUMN_METADATA  -DSQLITE_ENABLE_FTS3_PARENTHESIS  -DSQLITE_ENABLE_FTS4  -DSQLITE_ENABLE_LOAD_EXTENSION  -DSQLITE_ENABLE_UNLOCK_NOTIFY  -DSQLITE_HAVE_ISNAN --sysroot=/home/frank/netbsd/current/src/objamiga/destdir.amiga  -c    -fPIC -g /home/frank/netbsd/current/src/external/public-domain/sqli
 te/lib/../dist/sqlite3.c -o sqlite3.pico
/var/tmp//ccy5rdtq.s: Assembler messages:
/var/tmp//ccy5rdtq.s:102623: Warning: .word .L5817-.L5697+0 didn't fit
/var/tmp//ccy5rdtq.s:102623: Warning: .word .L6372-.L5697+0 didn't fit
/var/tmp//ccy5rdtq.s:102623: Warning: .word .L5817-.L5697+0 didn't fit
/var/tmp//ccy5rdtq.s:102623: Warning: .word .L6372-.L5697+0 didn't fit
---8<---


Is my fix of PICJUMP correct? I did the same for GCC45, and there it was
sufficient to build the whole userland with MKDEBUG and DBG options.

-- 
Frank Wille
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.