On 21/01/17 01:46, Segher Boessenkool wrote: > On Fri, Jan 20, 2017 at 08:35:14AM +0100, Sebastian Huber wrote: >>> so you seem to have 64-bit ABI_V4? I wonder how well tested that is, >>> you are likely to run into more problems. Either stack_restore_tie or >>> the above code will need a tweak. >> thanks for your help. I would had a hard time to figure this out myself. >> >> I am flexible in terms of the ABI choice for the 64-bit PowerPC. I guess >> the ABI_ELFv2 is the way to go? > It certainly is the most modern ABI. It makes some requirements to what > Power ISA features are required, which may or may not be a problem for > your platform. If you want to use BE, that should work with ELFv2 fine > (and it did in the past at least), but it doesn't get serious testing. I use now the attached patch and get the following error types (for several multilibs): /build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/xgcc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/ -nostdinc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/ -isystem /build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/targ-include -isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include -B/opt/rtems-4.12/powerpc-rtems4.12/bin/ -B/opt/rtems-4.12/powerpc-rtems4.12/lib/ -isystem /opt/rtems-4.12/powerpc-rtems4.12/include -isystem /opt/rtems-4.12/powerpc-rtems4.12/sys-include -g -O2 -mcpu=8540 -O2 -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../newlib/libc/sys/rtems/include -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../.././gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/. -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../include -DHAVE_CC_TLS -o ibm-ldouble.o -MT ibm-ldouble.o -MD -MP -MF ibm-ldouble.dep -c /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c -fvisibility=hidden -DHIDE_EXPORTS # the right startup files when linking shared libgcc. /bin/sh /home/EB/sebastian_h/archive/gcc-git/libgcc/../mkinstalldirs ../../.././gcc/m8540 parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"; \ for file in $parts; do \ rm -f ../../.././gcc/m8540/$file; \ /usr/bin/install -c -m 644 $file ../../.././gcc/m8540/; \ case $file in \ *.a) \ /opt/rtems-4.12/powerpc-rtems4.12/bin/ranlib ../../.././gcc/m8540/$file ;; \ esac; \ done In file included from /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:374:0: /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:72:1: error: unable to emulate 'TF' typedef float TFtype __attribute__ ((mode (TF))); ^~~~~~~ config.status: creating auto-target.h config.status: auto-target.h is unchanged config.status: executing default commands In file included from /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/soft-fp.h:321:0, from /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:372: /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c: In function 'fmsub': /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/op-common.h:900:10: warning: this statement may fall through [-Wimplicit-fallthrough=] R##_s = X##_s; \ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:182:29: note: in expansion of macro '_FP_MUL' # define FP_MUL_Q(R, X, Y) _FP_MUL (Q, 4, R, X, Y) ^~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:417:5: note: in expansion of macro 'FP_MUL_Q' FP_MUL_Q(U,X,Y); ^~~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/op-common.h:902:2: note: here case _FP_CLS_COMBINE (FP_CLS_INF, FP_CLS_INF): \ ^ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:182:29: note: in expansion of macro '_FP_MUL' # define FP_MUL_Q(R, X, Y) _FP_MUL (Q, 4, R, X, Y) ^~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:417:5: note: in expansion of macro 'FP_MUL_Q' FP_MUL_Q(U,X,Y); ^~~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/op-common.h:913:10: warning: this statement may fall through [-Wimplicit-fallthrough=] R##_s = Y##_s; \ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:182:29: note: in expansion of macro '_FP_MUL' # define FP_MUL_Q(R, X, Y) _FP_MUL (Q, 4, R, X, Y) ^~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:417:5: note: in expansion of macro 'FP_MUL_Q' FP_MUL_Q(U,X,Y); ^~~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/op-common.h:915:2: note: here case _FP_CLS_COMBINE (FP_CLS_NORMAL, FP_CLS_INF): \ ^ /home/EB/sebastian_h/archive/gcc-git/libgcc/soft-fp/quad.h:182:29: note: in expansion of macro '_FP_MUL' # define FP_MUL_Q(R, X, Y) _FP_MUL (Q, 4, R, X, Y) ^~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/config/rs6000/ibm-ldouble.c:417:5: note: in expansion of macro 'FP_MUL_Q' FP_MUL_Q(U,X,Y); ^~~~~~~~ /build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/xgcc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/ -nostdinc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/ -isystem /build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/targ-include -isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include -B/opt/rtems-4.12/powerpc-rtems4.12/bin/ -B/opt/rtems-4.12/powerpc-rtems4.12/lib/ -isystem /opt/rtems-4.12/powerpc-rtems4.12/include -isystem /opt/rtems-4.12/powerpc-rtems4.12/sys-include -g -O2 -mcpu=e6500 -m64 -msoft-float -mno-altivec -O2 -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../newlib/libc/sys/rtems/include -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../../../../.././gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/. -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../include -o unwind-dw2-fde.o -MT unwind-dw2-fde.o -MD -MP -MF unwind-dw2-fde.dep -fexceptions -c /home/EB/sebastian_h/archive/gcc-git/libgcc/unwind-dw2-fde.c -fvisibility=hidden -DHIDE_EXPORTS /home/EB/sebastian_h/archive/gcc-git/libgcc/unwind-dw2-fde.c: In function 'search_object': /home/EB/sebastian_h/archive/gcc-git/libgcc/unwind-dw2-fde.c:588:25: internal compiler error: in emit_move_insn, at expr.c:3698 v1->array[i1+i2] = v1->array[i1-1]; ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 0x6c49bb emit_move_insn(rtx_def*, rtx_def*) /home/EB/sebastian_h/archive/gcc-git/gcc/expr.c:3697 0x6a5c2b force_reg /home/EB/sebastian_h/archive/gcc-git/gcc/explow.c:648 0xd61994 rs6000_legitimize_address /home/EB/sebastian_h/archive/gcc-git/gcc/config/rs6000/rs6000.c:8873 0x6a6a21 memory_address_addr_space(machine_mode, rtx_def*, unsigned char) /home/EB/sebastian_h/archive/gcc-git/gcc/explow.c:432 0x6bfa0a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/EB/sebastian_h/archive/gcc-git/gcc/expr.c:10040 0x6cdb8c expand_expr /home/EB/sebastian_h/archive/gcc-git/gcc/expr.h:276 0x6cdb8c expand_assignment(tree_node*, tree_node*, bool) /home/EB/sebastian_h/archive/gcc-git/gcc/expr.c:5257 0x5b325c expand_gimple_stmt_1 /home/EB/sebastian_h/archive/gcc-git/gcc/cfgexpand.c:3641 0x5b325c expand_gimple_stmt /home/EB/sebastian_h/archive/gcc-git/gcc/cfgexpand.c:3737 0x5b50b9 expand_gimple_basic_block /home/EB/sebastian_h/archive/gcc-git/gcc/cfgexpand.c:5744 0x5bab16 execute /home/EB/sebastian_h/archive/gcc-git/gcc/cfgexpand.c:6357 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. /build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/xgcc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/ -nostdinc -B/build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/ -isystem /build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/newlib/targ-include -isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include -B/opt/rtems-4.12/powerpc-rtems4.12/bin/ -B/opt/rtems-4.12/powerpc-rtems4.12/lib/ -isystem /opt/rtems-4.12/powerpc-rtems4.12/include -isystem /opt/rtems-4.12/powerpc-rtems4.12/sys-include -g -O2 -mcpu=e6500 -m64 -O2 -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../newlib/libc/sys/rtems/include -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../../.././gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/. -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc/../include -o emutls.o -MT emutls.o -MD -MP -MF emutls.dep -fexceptions -c /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c -fvisibility=hidden -DHIDE_EXPORTS /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c: In function '__emutls_get_address': /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:159:13: warning: implicit declaration of function 'calloc' [-Wimplicit-function-declaration] arr = calloc (size + 1, sizeof (void *)); ^~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:159:13: warning: incompatible implicit declaration of built-in function 'calloc' /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:159:13: note: include '' or provide a declaration of 'calloc' /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:171:13: warning: implicit declaration of function 'realloc' [-Wimplicit-function-declaration] arr = realloc (arr, (size + 1) * sizeof (void *)); ^~~~~~~ /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:171:13: warning: incompatible implicit declaration of built-in function 'realloc' /home/EB/sebastian_h/archive/gcc-git/libgcc/emutls.c:171:13: note: include '' or provide a declaration of 'realloc' /tmp/ccoZ1J0W.s: Assembler messages: /tmp/ccoZ1J0W.s:125: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccoZ1J0W.s:125: Error: expression too complex /tmp/ccoZ1J0W.s:133: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} -- /tmp/ccUIJR3G.s:531: Error: expression too complex /tmp/ccUIJR3G.s:3339: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:3339: Error: expression too complex /tmp/ccUIJR3G.s:3550: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:3550: Error: expression too complex /tmp/ccUIJR3G.s:4147: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:4147: Error: expression too complex /tmp/ccUIJR3G.s:4249: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:4249: Error: expression too complex /tmp/ccUIJR3G.s:4342: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:4342: Error: expression too complex /tmp/ccUIJR3G.s:4385: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:4385: Error: expression too complex /tmp/ccUIJR3G.s:4556: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:4556: Error: expression too complex /tmp/ccUIJR3G.s:5415: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5415: Error: expression too complex /tmp/ccUIJR3G.s:5437: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5437: Error: expression too complex /tmp/ccUIJR3G.s:5656: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5656: Error: expression too complex /tmp/ccUIJR3G.s:5797: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5797: Error: expression too complex /tmp/ccUIJR3G.s:5859: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5859: Error: expression too complex /tmp/ccUIJR3G.s:5918: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:5918: Error: expression too complex /tmp/ccUIJR3G.s:6041: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6041: Error: expression too complex /tmp/ccUIJR3G.s:6042: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6042: Error: expression too complex /tmp/ccUIJR3G.s:6050: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6050: Error: expression too complex /tmp/ccUIJR3G.s:6363: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6363: Error: expression too complex /tmp/ccUIJR3G.s:6912: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6912: Error: expression too complex /tmp/ccUIJR3G.s:6957: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:6957: Error: expression too complex /tmp/ccUIJR3G.s:7030: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:7030: Error: expression too complex /tmp/ccUIJR3G.s:7127: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:7127: Error: expression too complex /tmp/ccUIJR3G.s:7254: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:7254: Error: expression too complex /tmp/ccUIJR3G.s:7371: Error: can't resolve `.got' {.got section} - `.LCTOC1' {*UND* section} /tmp/ccUIJR3G.s:7371: Error: expression too complex -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.