[LEDE-DEV] [Jool-list] It seems to me like the build system ignores EXTRA_FLAGS?
Alberto Leiva
ydahhrk at gmail.com
Thu Dec 1 07:48:27 PST 2016
> BTW my responses are not arriving at "Leve-dev at lists.infradead.org". Perhaps they haven't received anything.
Oh, it's just because my e-mails are HTML. Except Gmail says they're not. Weird.
On Thu, Dec 1, 2016 at 9:34 AM, Alberto Leiva <ydahhrk at gmail.com> wrote:
> Two cents:
>
> Not sure if "x86_64-openwrt-linux-musl-gcc" implies that you're using gcc,
> but at least in stock gcc, order matters. If you're going to force -largp,
> do so at the end, along with the other libraries.
>
> This is correct:
> gcc -Wall -O2 -I./../../include -I/usr/include/libnl3 -g -O2 -o
> jool_siit ../../common/netlink/jool_siit-config.o
> ../../common/stateless/jool_siit-xlat.o ../common/jool_siit-cJSON.o
> ../common/jool_siit-dns.o ../common/jool_siit-file.o
> ../common/jool_siit-jool.o ../common/jool_siit-netlink2.o
> ../common/jool_siit-str_utils.o ../common/argp/jool_siit-options.o
> ../common/nl/jool_siit-buffer.o ../common/target/jool_siit-bib.o
> ../common/target/jool_siit-eam.o ../common/target/jool_siit-global.o
> ../common/target/jool_siit-instance.o ../common/target/jool_siit-joold.o
> ../common/target/jool_siit-json.o ../common/target/jool_siit-log_time.o
> ../common/target/jool_siit-pool.o ../common/target/jool_siit-pool4.o
> ../common/target/jool_siit-pool6.o ../common/target/jool_siit-session.o
> -lnl-genl-3 -lnl-3 -lpthread -lm
>
> This spits lots of "undefined reference" errors (all I did was move the
> "-l"s):
> gcc -Wall -O2 -lnl-genl-3 -lnl-3 -lpthread -lm -I./../../include
> -I/usr/include/libnl3 -g -O2 -o jool_siit
> ../../common/netlink/jool_siit-config.o
> ../../common/stateless/jool_siit-xlat.o ../common/jool_siit-cJSON.o
> ../common/jool_siit-dns.o ../common/jool_siit-file.o
> ../common/jool_siit-jool.o ../common/jool_siit-netlink2.o
> ../common/jool_siit-str_utils.o ../common/argp/jool_siit-options.o
> ../common/nl/jool_siit-buffer.o ../common/target/jool_siit-bib.o
> ../common/target/jool_siit-eam.o ../common/target/jool_siit-global.o
> ../common/target/jool_siit-instance.o ../common/target/jool_siit-joold.o
> ../common/target/jool_siit-json.o ../common/target/jool_siit-log_time.o
> ../common/target/jool_siit-pool.o ../common/target/jool_siit-pool4.o
> ../common/target/jool_siit-pool6.o ../common/target/jool_siit-session.o
>
> Here's a dicussion on this topic: http://stackoverflow.com/questions/45135
> Also, have you seen this? https://github.com/openwrt/packages/issues/1535
>
> BTW my responses are not arriving at "Leve-dev at lists.infradead.org". Perhaps
> they haven't received anything.
>
> On Thu, Dec 1, 2016 at 2:57 AM, Dan Lüdtke <mail at danrl.com> wrote:
>>
>>
>> > AC_SEARCH_LIBS([argp_parse], [argp])
>>
>>
>> Result:
>> > checking for pow... no
>> > checking for library containing pow... -lm
>> > checking for library containing pthread_create... -lpthread
>> > checking for library containing argp_parse... none required <<<---
>> > checking pkg-config is at least version 0.9.0... yes
>> > checking for LIBNLGENL3... yes
>> > checking that generated files are newer than configure... done
>> > configure: creating ./config.status
>> > config.status: creating Makefile
>> > config.status: creating stateless/Makefile
>> > config.status: creating stateful/Makefile
>> > config.status: creating joold/Makefile
>> > config.status: executing depfiles commands
>>
>> Sigh. It checks for the lib but doesn't think it needs it. Shouldn't this
>> be running all under the same toolchain?
>>
>> I think it may be the LEDE build system that is screwing this one up. Or
>> my Makefile is totally nuts (possible, not very experienced in LEDE build
>> system).
>>
>> It get's worse. If I force -largp, the error stays the same:
>> > x86_64-openwrt-linux-musl-gcc -Wall -O2 -largp -I./../../include
>> > -I/home/danrl/lede/nat64/source/staging_dir/target-x86_64_musl-1.1.15/usr/include/libnl3
>> > -o jool ../../common/netlink/jool-config.o ../../common/stateful/jool-xlat.o
>> > ../common/jool-cJSON.o ../common/jool-dns.o ../common/jool-file.o
>> > ../common/jool-jool.o ../common/jool-netlink2.o ../common/jool-str_utils.o
>> > ../common/argp/jool-options.o ../common/nl/jool-buffer.o
>> > ../common/target/jool-bib.o ../common/target/jool-eam.o
>> > ../common/target/jool-global.o ../common/target/jool-instance.o
>> > ../common/target/jool-joold.o ../common/target/jool-json.o
>> > ../common/target/jool-log_time.o ../common/target/jool-pool.o
>> > ../common/target/jool-pool4.o ../common/target/jool-pool6.o
>> > ../common/target/jool-session.o
>> > -L/home/danrl/lede/nat64/source/staging_dir/target-x86_64_musl-1.1.15/usr/lib
>> > -lnl-genl-3 -lnl-3 -lpthread -lm
>> > ../common/jool-jool.o: In function `main':
>> > jool.c:(.text.startup+0x89): undefined reference to `argp_parse'
>> > collect2: error: ld returned 1 exit status
>> > Makefile:504: recipe for target 'jool' failed
>> > make[6]: *** [jool] Error 1
>>
>>
>> However, if I force -largp-standalone (nonexistent) the linker exits
>> complaining about how it could not find the lib. This means, in the previous
>> command (with forced -largp) the linker found the lib but did not think it
>> helps linking argp_parse. Why is that?
>>
>>
>> Maybe someone from LEDE can help explain this?
>>
>>
>
More information about the Lede-dev
mailing list