<div dir="ltr"><div>Two cents:<br><br>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.<br><br>This is correct:<br>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 <br><br>This spits lots of "undefined reference" errors (all I did was move the "-l"s):<br>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<br><br>Here's a dicussion on this topic: <a href="http://stackoverflow.com/questions/45135">http://stackoverflow.com/questions/45135</a><br>Also, have you seen this? <a href="https://github.com/openwrt/packages/issues/1535">https://github.com/openwrt/packages/issues/1535</a><br><br></div>BTW my responses are not arriving at "<a href="mailto:Leve-dev@lists.infradead.org">Leve-dev@lists.infradead.org</a>". Perhaps they haven't received anything.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 2:57 AM, Dan Lüdtke <span dir="ltr"><<a href="mailto:mail@danrl.com" target="_blank">mail@danrl.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
>     AC_SEARCH_LIBS([argp_parse], [argp])<br>
<br>
<br>
</span>Result:<br>
<span class="">> checking for pow... no<br>
> checking for library containing pow... -lm<br>
> checking for library containing pthread_create... -lpthread<br>
> checking for library containing argp_parse... none required <<<---<br>
</span>> checking pkg-config is at least version 0.9.0... yes<br>
> checking for LIBNLGENL3... yes<br>
> checking that generated files are newer than configure... done<br>
> configure: creating ./config.status<br>
> config.status: creating Makefile<br>
> config.status: creating stateless/Makefile<br>
> config.status: creating stateful/Makefile<br>
> config.status: creating joold/Makefile<br>
> config.status: executing depfiles commands<br>
<br>
Sigh. It checks for the lib but doesn't think it needs it. Shouldn't this be running all under the same toolchain?<br>
<br>
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).<br>
<br>
It get's worse. If I force -largp, the error stays the same:<br>
> x86_64-openwrt-linux-musl-gcc -Wall -O2 -largp -I./../../include -I/home/danrl/lede/nat64/<wbr>source/staging_dir/target-x86_<wbr>64_musl-1.1.15/usr/include/<wbr>libnl3     -o jool ../../common/netlink/jool-<wbr>config.o ../../common/stateful/jool-<wbr>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-<wbr>instance.o ../common/target/jool-joold.o ../common/target/jool-json.o ../common/target/jool-log_<wbr>time.o ../common/target/jool-pool.o ../common/target/jool-pool4.o ../common/target/jool-pool6.o ../common/target/jool-session.<wbr>o -L/home/danrl/lede/nat64/<wbr>source/staging_dir/target-x86_<wbr>64_musl-1.1.15/usr/lib -lnl-genl-3 -lnl-3 -lpthread -lm<br>
<span class="">> ../common/jool-jool.o: In function `main':<br>
> jool.c:(.text.startup+0x89): undefined reference to `argp_parse'<br>
> collect2: error: ld returned 1 exit status<br>
> Makefile:504: recipe for target 'jool' failed<br>
> make[6]: *** [jool] Error 1<br>
<br>
<br>
</span>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?<br>
<br>
<br>
Maybe someone from LEDE can help explain this?<br>
<br>
<br>
</blockquote></div><br></div>