Exciting 4.12 link error

Gedare Bloom gedare at rtems.org
Tue Mar 8 03:26:07 UTC 2016


On Mon, Mar 7, 2016 at 4:10 PM, Isaac Gutekunst
<isaac.gutekunst at vecna.com> wrote:
>
>
> On 03/07/2016 03:54 PM, Joel Sherrill wrote:
>>
>>
>>
>> On Mon, Mar 7, 2016 at 2:32 PM, Isaac Gutekunst <isaac.gutekunst at vecna.com
>> <mailto:isaac.gutekunst at vecna.com>> wrote:
>>
>>     Hi All,
>>
>>     I've updated our BSP and added it to a local branch of master. It now
>>     compiles fine, but linking fails with a variety of libstdc++ errors,
>> as
>>     well as a taking up more space than we have available in internal ROM,
>>     at least according to the error.
>>
>>
>>     Is there anything we should know about working off master at the
>> moment
>>     to make things work?
>>
>>
>> It looks like it is missing the C library and RTEMS on the link. Weird.
>
>
> I don't think so, as I don't know what those are :)
>
> I'm using a Makefile that worked with 4.11.  Is there stuff that may no
> longer work?
>
> We also have a bunch of CPU specific flags that may not be getting to the
> right place.
>
> We have this in the makefile:
> CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -march=armv7-m -mthumb
>
> I know that ideally these should be in a bsp specific make/bspname.conf
> file.
>
>
> Otherwise, these seem like C++ errors.
>
> Here are some of the parts of our Makefile I think are important. In
> reality, we also link
> some additional static libraries, but I don't *think* those are the problem.
> We have
> recompiled the static libraries with the new CFLAGS.
>
>
> PGM=${ARCH}/nextgen.exe
>
> # optional managers required
> MANAGERS=all
>
> # C source names
> CSRCS = init.c          \
>         heartbeat_led.c \
>         rtems_shell.c   \
>         web_server.c    \
>         FilesystemImage.c
>
>
>
> COBJS = $(CSRCS:%.c=${ARCH}/%.o)
>
> PROJECT_ROOT=$(RTEMS_MAKEFILE_PATH)
>
> CLEAN_ADDITIONS += stamp-fs-image
> CLEAN_ADDITIONS += FilesystemImage FilesystemImage.c FilesystemImage.h
>
>
> include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
> include $(RTEMS_CUSTOM)
> include $(PROJECT_ROOT)/make/leaf.cfg
>
> BSP_PATH=$(RTEMS_MAKEFILE_PATH)/lib/include/bsp
>
>
>
> OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
>
> all:    ${ARCH} $(PGM)
>
> $(PGM): $(OBJS)
>     $(make-cxx-exe)
>
>
>
>>
>> Do you have per-section compile and link options turned on?
>>
>> --joel
>>
>>     Thanks,
>>
>>     Isaac
>>
>>
>>     Link Error for reference:
>>
>>
>>     COLLECT_GCC=arm-rtems4.12-g++
>>
>> COLLECT_LTO_WRAPPER=/home/igutek/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/6.0.0/lto-wrapper
>>     Target: arm-rtems4.12
>>     Configured with: ../gcc-6-20160228/configure
>> --prefix=/home/igutek/rtems/compiler/4.12
>> --bindir=/home/igutek/rtems/compiler/4.12/bin
>> --exec_prefix=/home/igutek/rtems/compiler/4.12
>> --includedir=/home/igutek/rtems/compiler/4.12/include
>> --libdir=/home/igutek/rtems/compiler/4.12/lib
>> --libexecdir=/home/igutek/rtems/compiler/4.12/libexec
>> --mandir=/home/igutek/rtems/compiler/4.12/share/man
>> --infodir=/home/igutek/rtems/compiler/4.12/share/info
>> --datadir=/home/igutek/rtems/compiler/4.12/share --build=x86_64-linux-gnu
>> --host=x86_64-linux-gnu --target=arm-rtems4.12 --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,
>>     i
>>
>> so_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-libgomp --enable-languages=c,c++
>>     Thread model: rtems
>>     gcc version 6.0.0 20160228 (RTEMS 4.12, RSB
>> b537e5536459e207fc8e56a1df3774c1700606d5, Newlib 2.3.0.20160226) (GCC)
>>
>> COMPILER_PATH=/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib/:/home/igutek/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/6.0.0/:/home/igutek/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/6.0.0/:/home/igutek/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/bin/
>>
>> LIBRARY_PATH=/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/lib/thumb/armv7-m/fpv4-sp-d16/hard/:/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/:/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/lib/
>>     COLLECT_GCC_OPTIONS='-B'
>> '/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib/'
>> '-specs=bsp_specs' '-qrtems' '-Wall' '-O0' '-g' '-march=armv7-m' '-mthumb'
>> '-mfloat-abi=hard' '-mfpu=fpv4-sp-d16' '-march=armv7-m' '-mthumb'
>> '-mfloat-abi=hard' '-mfpu=fpv4-sp-d16' '-o' 'o-debug/nextgen.exe'
>> '-L/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lwip/lib'
>> '-L/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/stm32f_lwip/lib' '-v'
>> '-L./clyde-rtems-demo/output/lib/clyde-rtems-demo/'
>>
>> /home/igutek/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/6.0.0/collect2
>> -dc -dp -N -o o-debug/nextgen.exe
>> /home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib/start.o
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard/crti.o
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard/crtbegin.o
>> -e _start -L/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lwip/lib
>> -L/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/stm32f_lwip/lib
>> -L./clyde-rtems-demo/output/lib/clyde-rtems-demo/
>> -L/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard
>> -L/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/lib/thumb/armv7-m/fpv4-sp-d16/hard
>> -L/home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib
>> -L/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0
>>
>> -L/home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/l
>>     i
>>     b o-debug/init.o o-debug/heartbeat_led.o o-debug/rtems_shell.o
>> o-debug/web_server.o o-debug/FilesystemImage.o -Map=o-debug/next_gen.map
>> -lclyde-rtems-demo-0.0.0 -lstdc++ -lm --start-group -lgcc --start-group
>> -lrtemsbsp -lrtemscpu -lz -lm -lc -lgcc --end-group -T
>> /home/igutek/rtems/lib-rtems/arm-rtems4.12/stm32f7x/lib/linkcmds --end-group
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard/crtend.o
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/thumb/armv7-m/fpv4-sp-d16/hard/crtn.o
>>
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/bin/ld:
>> o-debug/nextgen.exe section `.ARM.extab' will not fit in region `ROM_INT'
>>
>> /home/igutek/rtems/compiler/4.12/lib/gcc/arm-rtems4.12/6.0.0/../../../../arm-rtems4.12/bin/ld:
>> region `ROM_INT' overflowed by 48838 bytes
>>
That suggests about 48K of "code" is getting lost.

What is the size of the FilesystemImage you link in your application?

Note that "MANAGERS=" no longer has any effect.

I'd suggest to get the Makefile.cfg right for the BSP and rely on that
to propagate the cflags.



More information about the users mailing list