Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
For the reference, -flto option was preventing static linker from making the assignments. Could be very well something specific to our toolchain. On Fri, Dec 12, 2014 at 11:50 PM, Umut Tezduyar Lindskog wrote: > On Fri, Dec 12, 2014 at 4:46 PM, Lennart Poettering > wrote: >> On Fri, 12.12.14 10:10, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: >> >>> > >>> > https://sourceware.org/bugzilla/show_bug.cgi?id=11133 >>> > >>> > But that's 4y old... Or is your toolchain that old? >>> >>> Shouldn't be: >>> >>> mipsisa32r2el-axis-linux-gnu-gcc --version >>> mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24) >>> 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] >> >> That's the gcc version. And what binutils version is this? > > mipsisa32r2el-axis-linux-gnu-ld --version > GNU ld (GNU Binutils) 2.24.51.20131126 > Copyright 2013 Free Software Foundation, Inc. > This program is free software; you may redistribute it under the terms of > the GNU General Public License version 3 or (at your option) a later version. > This program has absolutely no warranty. > > I will double check things with our compiler tools group. > >> >> Lennart >> >> -- >> Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
On Fri, Dec 12, 2014 at 4:46 PM, Lennart Poettering wrote: > On Fri, 12.12.14 10:10, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: > >> > >> > https://sourceware.org/bugzilla/show_bug.cgi?id=11133 >> > >> > But that's 4y old... Or is your toolchain that old? >> >> Shouldn't be: >> >> mipsisa32r2el-axis-linux-gnu-gcc --version >> mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24) >> 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] > > That's the gcc version. And what binutils version is this? mipsisa32r2el-axis-linux-gnu-ld --version GNU ld (GNU Binutils) 2.24.51.20131126 Copyright 2013 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. I will double check things with our compiler tools group. > > Lennart > > -- > Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
On Fri, 12.12.14 10:10, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=11133 > > > > But that's 4y old... Or is your toolchain that old? > > Shouldn't be: > > mipsisa32r2el-axis-linux-gnu-gcc --version > mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24) > 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] That's the gcc version. And what binutils version is this? Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
In case someone has an idea, here is the full linker command: /bin/sh ./libtool --tag=CC --mode=link mipsisa32r2el-axis-linux-gnu-gcc -isystem /build/target/mipsisa32r2el-axis-linux-gnu/include -isystem /build/target/mipsisa32r2el-axis-linux-gnu/usr/include -std=gnu99 -pipe -Wall -Wextra -Wno-inline -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wsign-compare -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=overflow -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector -fPIE --param=ssp-buffer-size=4 -flto -ffat-lto-objects -Wall -Wshadow -O2 -g3 -D_FORTIFY_SOURCE=2 -fstack-protector -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -pie -Wl,-fuse-ld=gold -module -export-dynamic -avoid-version -shared -shrext .so.2 -Wl,--version-script=/build/apps/systemd/systemd/src/nss-resolve/nss-resolve.sym -L/build/target/mipsisa32r2el-axis-linux-gnu/lib -L/build/target/mipsisa32r2el-axis-linux-gnu/usr/lib -Wl,-rpath-link,/build/target/mipsisa32r2el-axis-linux-gnu/lib:/build/target/mipsisa32r2el-axis-linux-gnu/usr/lib -o libnss_resolve.la -rpath /usr/lib src/nss-resolve/nss-resolve.lo libsystemd-shared.la libsystemd-internal.la -lrt -ldl On Fri, Dec 12, 2014 at 10:10 AM, Umut Tezduyar Lindskog wrote: > On Fri, Dec 12, 2014 at 12:24 AM, Lennart Poettering > wrote: >> On Thu, 11.12.14 23:01, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: >> >>> Trying to build 218 but I am getting undefined reference error. The >>> source code of bus-error.c mentions that gcc magically maps these >>> variables but not for me. >>> >>> What is doing the mapping? __attribute__ ((__section__("BUS_ERROR_MAP"))) ? >>> >>> Could it be that mentioned "gcc magic" is not supported on cross compiling? >>> >>> Also, why do we need to use elf section instead of iterating over >>> bus_standard_errors[]? >> >> The idea is that any .c file linked into a binary can define >> additional maps, and we collect them all simply by iterating through >> __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP. >> >> The __start_XYZ/__stop_XYZ magic is pretty old ld/gold stuff, support >> since a long time. >> >> Is there something fishy with your toolchain? Any particular build >> time options you turned on or off? Some really old ld >> versions would end up dropping these sections a bit too eagerly: > > Maybe. I will ask this internally too. > >> >> https://sourceware.org/bugzilla/show_bug.cgi?id=11133 >> >> But that's 4y old... Or is your toolchain that old? > > Shouldn't be: > > mipsisa32r2el-axis-linux-gnu-gcc --version > mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24) > 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] > > >> >>> CCLD libnss_resolve.la >>> libsystemd_shared_la-hashmap.o (symbol from plugin): warning: memset >>> used with constant zero length parameter; this could be due to >>> transposed parameters >>> /tmp/ccHr0vVt.ltrans13.ltrans.o: In function >>> `bus_error_name_to_errno.14134': >>> ccHr0vVt.ltrans13.o:(.text+0x7b0): undefined reference to >>> `__start_BUS_ERROR_MAP' >>> ccHr0vVt.ltrans13.o:(.text+0x7b4): undefined reference to >>> `__stop_BUS_ERROR_MAP' >>> collect2: error: ld returned 1 exit status >>> >>> Umut >>> ___ >>> systemd-devel mailing list >>> systemd-devel@lists.freedesktop.org >>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel >> >> >> Lennart >> >> -- >> Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
On Fri, Dec 12, 2014 at 12:24 AM, Lennart Poettering wrote: > On Thu, 11.12.14 23:01, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: > >> Trying to build 218 but I am getting undefined reference error. The >> source code of bus-error.c mentions that gcc magically maps these >> variables but not for me. >> >> What is doing the mapping? __attribute__ ((__section__("BUS_ERROR_MAP"))) ? >> >> Could it be that mentioned "gcc magic" is not supported on cross compiling? >> >> Also, why do we need to use elf section instead of iterating over >> bus_standard_errors[]? > > The idea is that any .c file linked into a binary can define > additional maps, and we collect them all simply by iterating through > __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP. > > The __start_XYZ/__stop_XYZ magic is pretty old ld/gold stuff, support > since a long time. > > Is there something fishy with your toolchain? Any particular build > time options you turned on or off? Some really old ld > versions would end up dropping these sections a bit too eagerly: Maybe. I will ask this internally too. > > https://sourceware.org/bugzilla/show_bug.cgi?id=11133 > > But that's 4y old... Or is your toolchain that old? Shouldn't be: mipsisa32r2el-axis-linux-gnu-gcc --version mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24) 4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527] > >> CCLD libnss_resolve.la >> libsystemd_shared_la-hashmap.o (symbol from plugin): warning: memset >> used with constant zero length parameter; this could be due to >> transposed parameters >> /tmp/ccHr0vVt.ltrans13.ltrans.o: In function `bus_error_name_to_errno.14134': >> ccHr0vVt.ltrans13.o:(.text+0x7b0): undefined reference to >> `__start_BUS_ERROR_MAP' >> ccHr0vVt.ltrans13.o:(.text+0x7b4): undefined reference to >> `__stop_BUS_ERROR_MAP' >> collect2: error: ld returned 1 exit status >> >> Umut >> ___ >> systemd-devel mailing list >> systemd-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/systemd-devel > > > Lennart > > -- > Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
Hi, On Fri, Dec 12, 2014 at 7:56 AM, Matthias Urlichs wrote: > Hi, > > Lennart: >> >> The idea is that any .c file linked into a binary can define >> additional maps, and we collect them all simply by iterating through >> __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP. >> > Unless there are none of these entries. > > Umut: Does the cross compiling somehow not include any > data that are in section BUS_ERROR_MAP? This doesn't seem to be the case. I looked at the libsystemd_la-bus-error.o and I have the BUS_ERROR_MAP section with size 0x118 which matches with source code 32bit mips [1]. The __start_BUS_ERROR_MAP, __stop_BUS_ERROR_MAP symbols are in the object file too as unresolved [2]. Somehow static linker doesn't resolve the symbols to section begin/end. Any other suggestions? [1] - https://drive.google.com/open?id=0B_uiALgWpGXtSVpUR3pwcWNodGc&authuser=0 [2] - https://drive.google.com/open?id=0B_uiALgWpGXtNGFKSlR4VjN4MGM&authuser=0 Umut > > If that's actually intended, this should fix it: > > char dummy_bus_error_map[0] __attribute__ ((__section__("BUS_ERROR_MAP"))); > > -- > -- Matthias Urlichs > > ___ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel > ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
Hi, Lennart: > > The idea is that any .c file linked into a binary can define > additional maps, and we collect them all simply by iterating through > __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP. > Unless there are none of these entries. Umut: Does the cross compiling somehow not include any data that are in section BUS_ERROR_MAP? If that's actually intended, this should fix it: char dummy_bus_error_map[0] __attribute__ ((__section__("BUS_ERROR_MAP"))); -- -- Matthias Urlichs signature.asc Description: Digital signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
On Thu, 11.12.14 23:01, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote: > Trying to build 218 but I am getting undefined reference error. The > source code of bus-error.c mentions that gcc magically maps these > variables but not for me. > > What is doing the mapping? __attribute__ ((__section__("BUS_ERROR_MAP"))) ? > > Could it be that mentioned "gcc magic" is not supported on cross compiling? > > Also, why do we need to use elf section instead of iterating over > bus_standard_errors[]? The idea is that any .c file linked into a binary can define additional maps, and we collect them all simply by iterating through __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP. The __start_XYZ/__stop_XYZ magic is pretty old ld/gold stuff, support since a long time. Is there something fishy with your toolchain? Any particular build time options you turned on or off? Some really old ld versions would end up dropping these sections a bit too eagerly: https://sourceware.org/bugzilla/show_bug.cgi?id=11133 But that's 4y old... Or is your toolchain that old? > CCLD libnss_resolve.la > libsystemd_shared_la-hashmap.o (symbol from plugin): warning: memset > used with constant zero length parameter; this could be due to > transposed parameters > /tmp/ccHr0vVt.ltrans13.ltrans.o: In function `bus_error_name_to_errno.14134': > ccHr0vVt.ltrans13.o:(.text+0x7b0): undefined reference to > `__start_BUS_ERROR_MAP' > ccHr0vVt.ltrans13.o:(.text+0x7b4): undefined reference to > `__stop_BUS_ERROR_MAP' > collect2: error: ld returned 1 exit status > > Umut > ___ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'
Trying to build 218 but I am getting undefined reference error. The source code of bus-error.c mentions that gcc magically maps these variables but not for me. What is doing the mapping? __attribute__ ((__section__("BUS_ERROR_MAP"))) ? Could it be that mentioned "gcc magic" is not supported on cross compiling? Also, why do we need to use elf section instead of iterating over bus_standard_errors[]? CCLD libnss_resolve.la libsystemd_shared_la-hashmap.o (symbol from plugin): warning: memset used with constant zero length parameter; this could be due to transposed parameters /tmp/ccHr0vVt.ltrans13.ltrans.o: In function `bus_error_name_to_errno.14134': ccHr0vVt.ltrans13.o:(.text+0x7b0): undefined reference to `__start_BUS_ERROR_MAP' ccHr0vVt.ltrans13.o:(.text+0x7b4): undefined reference to `__stop_BUS_ERROR_MAP' collect2: error: ld returned 1 exit status Umut ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel