Following up to myself... I don't know exactly how to fix this but I think I have pulled the right thread.
gcc/config/sh/superh.h defined SUBTARGET_LINK_SPEC which appears to have the right arguments. sh-rtems4.11-gcc -dumpspecs shows that *link ends with "%(subtarget_link_spec} which seems correct. But that is defined to nothing when I think it should be "%{ml:-EL}%{mb|!ml:-EB}" configure.gcc shows that sh-superh-elf includes these which are not in the sh-rtems*) target: tm_file="${tm_file} sh/superh.h" extra_options="${extra_options} sh/superh.opt" ;; Do we need to add those? Anything else we might be missing? On 5/5/2014 11:37 AM, Joel Sherrill wrote: > Hi > > We have a few build failures on the RTEMS target where it appears > that the -ml argument to make a relocatable is not turned into a > -EL argument to ld by gcc 4.8.2. > > This is the output of invoking gcc with "-v". Below that I invoked > the same LD command with -EL on the command line and it > worked. > > Any ideas or suggestions? > > $ sh-rtems4.11-gcc --pipe -B../../../../.././lib/ > -B../../../../.././simsh2e/lib/ -specs bsp_specs -qrtems -m2e -ml -O2 > -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration > -Wstrict-prototypes -Wnested-externs -qnolinkcmds -nostdlib -r -o > cache.rel ../shared/src/cache_rel-cache_aligned_malloc.o > ../shared/src/cache_rel-cache_manager.o -v > Using built-in specs. > Reading specs from ../../../../.././simsh2e/lib/bsp_specs > rename spec endfile to old_endfile > rename spec startfile to old_startfile > rename spec link to old_link > COLLECT_GCC=sh-rtems4.11-gcc > COLLECT_LTO_WRAPPER=/users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/4.8.2/lto-wrapper > Target: sh-rtems4.11 > Configured with: ../gcc-4.8.2/configure > --prefix=/users/joel/rtems-4.11-work/tools > --bindir=/users/joel/rtems-4.11-work/tools/bin > --exec_prefix=/users/joel/rtems-4.11-work/tools > --includedir=/users/joel/rtems-4.11-work/tools/include > --libdir=/users/joel/rtems-4.11-work/tools/lib > --libexecdir=/users/joel/rtems-4.11-work/tools/libexec > --mandir=/users/joel/rtems-4.11-work/tools/share/man > --infodir=/users/joel/rtems-4.11-work/tools/share/info > --datadir=/users/joel/rtems-4.11-work/tools/share > --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sh-rtems4.11 > --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --verbose > --with-newlib --with-system-zlib --disable-nls > --without-included-gettext --disable-win32-registry > --enable-version-specific-runtime-libs --disable-lto > --enable-newlib-io-c99-formats --enable-newlib-iconv > --enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,win_1253,win_1254,win_1255,win_1256,win_1257,win_1258 > --enable-threads --disable-plugin --enable-languages=c,c++ > Thread model: rtems > gcc version 4.8.2 20131016 (RTEMS > 4.11-RSB-6fe63b3f553bb3157c7b8256917152ca36450fd4-1,gcc-4.8.2/newlib-2.1.0) > (GCC) > COMPILER_PATH=../../../../.././simsh2e/lib/:/users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/4.8.2/:/users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/4.8.2/:/users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ > LIBRARY_PATH=/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/ml/m2e/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib/ml/m2e/:../../../../.././simsh2e/lib/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/:/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib/ > COLLECT_GCC_OPTIONS='-pipe' '-B' '../../../../.././lib/' '-B' > '../../../../.././simsh2e/lib/' '-specs=bsp_specs' '-qrtems' '-m2e' > '-ml' '-O2' '-g' '-Wall' '-Wmissing-prototypes' > '-Wimplicit-function-declaration' '-Wstrict-prototypes' > '-Wnested-externs' '-qnolinkcmds' '-nostdlib' '-r' '-o' 'cache.rel' '-v' > /users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/4.8.2/collect2 > -dc -dp -N -o cache.rel -r > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/ml/m2e > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib/ml/m2e > -L../../../../.././simsh2e/lib > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2 > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib > ../shared/src/cache_rel-cache_aligned_malloc.o > ../shared/src/cache_rel-cache_manager.o > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > ../shared/src/cache_rel-cache_aligned_malloc.o: compiled for a little > endian system and target is big endian > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > ../shared/src/cache_rel-cache_aligned_malloc.o: uses instructions which > are incompatible with instructions used in previous modules > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > failed to merge target specific data of file > ../shared/src/cache_rel-cache_aligned_malloc.o > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > ../shared/src/cache_rel-cache_manager.o: compiled for a little endian > system and target is big endian > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > ../shared/src/cache_rel-cache_manager.o: uses instructions which are > incompatible with instructions used in previous modules > /users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/bin/ld: > failed to merge target specific data of file > ../shared/src/cache_rel-cache_manager.o > collect2: error: ld returned 1 exit status > > > > [joel@rtbf64a sh]$ > /users/joel/rtems-4.11-work/tools/libexec/gcc/sh-rtems4.11/4.8.2/collect2 -dc > -dp -N -o cache.rel -r > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/ml/m2e > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib/ml/m2e > -L../../../../.././simsh2e/lib > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2 > -L/users/joel/rtems-4.11-work/tools/lib/gcc/sh-rtems4.11/4.8.2/../../../../sh-rtems4.11/lib > ../shared/src/cache_rel-cache_aligned_malloc.o > ../shared/src/cache_rel-cache_manager.o -EL > -- Joel Sherrill, Ph.D. Director of Research & Development joel.sherr...@oarcorp.com On-Line Applications Research Ask me about RTEMS: a free RTOS Huntsville AL 35805 Support Available (256) 722-9985