assarbad / build-asuswrt-merlin

Helpers to build RMerl/asuswrt-merlin without much extra typing
The Unlicense
43 stars 19 forks source link

RT-AC56U fails due to missing libxml2 (ARM) #9

Open assarbad opened 9 years ago

assarbad commented 9 years ago

The source is included, but all binary libs are exclusively for MIPS

assarbad commented 9 years ago
arm-brcm-linux-uclibcgnueabi-ld -shared -o libws.so output/ws_src/curl_api.o output/ws_src/parse_xml.o output/ws_src/wb.o output/ws_src/wb_util.o output/ws_src/ssl_api.o output/ws_src/log.o -L/data/oliver/asus-merlin-local/release/src-rt
-6.x.4708/router/openssl -lcrypto -lssl -L/data/oliver/asus-merlin-local/release/src-rt-6.x.4708/router/curl-7.21.7/lib/.libs -lcurl -L/data/oliver/asus-merlin-local/release/src-rt-6.x.4708/router/libxml2/.libs -lxml2
arm-brcm-linux-uclibcgnueabi-ld: skipping incompatible /data/oliver/asus-merlin-local/release/src-rt-6.x.4708/router/libxml2/.libs/libxml2.so when searching for -lxml2
arm-brcm-linux-uclibcgnueabi-ld: skipping incompatible /data/oliver/asus-merlin-local/release/src-rt-6.x.4708/router/libxml2/.libs/libxml2.a when searching for -lxml2
arm-brcm-linux-uclibcgnueabi-ld: cannot find -lxml2
wabee commented 9 years ago

Tried running the script in "sudo-mode" and got a different error. This time involving libxml2:

---- Output ----
checking that generated files are newer than configure... done
configure: creating ./config.status
Done configuring
make[4]: Leaving directory `/home/bengt/asuswrt-merlin/release/src/router/libxml2'
make[3]: *** [libxml2] Error 2
make[3]: Leaving directory `/home/bengt/asuswrt-merlin/release/src/router'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/bengt/asuswrt-merlin/release/src-rt'
make[1]: *** [bin] Error 2
make[1]: Leaving directory `/home/bengt/asuswrt-merlin/release/src-rt'
make: *** [rt-n16] Error 2
make: Leaving directory `/home/bengt/asuswrt-merlin/release/src-rt'
Your image can be found here:
    release/src-rt/image/*.trx
assarbad commented 9 years ago

Is that the complete output?

Also, how is this different from this issue? It seems like it is exactly what this issue is about.

wabee commented 9 years ago

Same module different error. Can mail you config.log if you supply me with an email address

YasharF commented 9 years ago

I am seeing warn issues about automake version mismatch for the build portion related to libxml2 in the logs when building for MIPS based RT-N16 build. Here is the portion from the log of the current asuswrt-merlin github repo code:

touch libxml2/stamp-h1
make -C libxml2 all -j`grep -c '^processor' /proc/cpuinfo`
make[4]: Entering directory `~/release/src/router/libxml2'
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash ~/release/src/router/libxml2/missing --run autoconf
 cd . && /bin/bash ~/release/src/router/libxml2/missing --run automake-1.11 --gnu
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
/bin/bash ./config.status --recheck
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
configure.in:50: version mismatch.  This is Automake 1.11.6,
configure.in:50: but the definition used by this AM_INIT_AUTOMAKE
configure.in:50: comes from Automake 1.14.1.  You should recreate
configure.in:50: aclocal.m4 with aclocal and run automake again.
running CONFIG_SHELL=/bin/bash /bin/bash ././configure --host=mipsel-linux --build= --prefix=/usr --without-python --disable-dependency-tracking build_alias= host_alias=mipsel-linux CC=mipsel-uclibc-gcc CFLAGS=-Os -Wall -DLINUX26 -DCONFIG_BCMWL5 -DDEBUG_NOISY -DDEBUG_RCTEST -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32r2 -mips32r2 -DLINUX_KERNEL_VERSION=132630  LDFLAGS=-ldl --no-create --no-recursion
configure.in:53: required file `./compile' not found
configure.in:53:   `automake --add-missing' can install `compile'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
~/release/src/router/libxml2/missing: Unknown `--is-lightweight' option
Try `~/release/src/router/libxml2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
victor-rds commented 9 years ago

Same happens when building RT-AC68U, I was building with IPSec support and got the same error:

Disabling code coverage for GCC
checking that generated files are newer than configure... done
configure: creating ./config.status
Done configuring
make[4]: Leaving directory '/home/victor/asus/asuswrt-merlin/release/src/router/libxml2'
Makefile:3186: recipe for target 'libxml2' failed
make[3]: *** [libxml2] Error 2
make[3]: Leaving directory '/home/victor/asus/asuswrt-merlin/release/src/router'
Makefile:170: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/victor/asus/asuswrt-merlin/release/src-rt-6.x.4708'
Makefile:2179: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/home/victor/asus/asuswrt-merlin/release/src-rt-6.x.4708'
Makefile:2235: recipe for target 'rt-ac68u' failed
make: *** [rt-ac68u] Error 2
make: Leaving directory '/home/victor/asus/asuswrt-merlin/release/src-rt-6.x.4708'
Your image can be found here:
        release/src-rt-6.x.4708/image/RT-AC68U_378.53_0.trx

CLEANUP: extended cleanup of source tree changes
+ mv /home/victor/asus/asuswrt-merlin/release/src/router/libxml2/configure.in.BAK-build-image /home/victor/asus/asuswrt-merlin/release/src/router/libxml2/configure.in

Also this fixed my build: http://www.snbforums.com/threads/stock-asuswrt-ac56u-libxml-build-problem.22904/

assarbad commented 9 years ago

@YasharF: did you install the prerequisites accordingly?

@victor-rds: so pass --add-missing to all automake command lines or to particular ones? I can probably include that in the script, but the forum post is either cut off or a bit vague.

YasharF commented 9 years ago

I reran using ./debian-build-image --prereq RT-N16 and I don't see the message about "Automake 1.11.6" anymore. The following I think is the log for the same section.

touch libxml2/stamp-h1
make -C libxml2 all -j`grep -c '^processor' /proc/cpuinfo`
make[4]: Entering directory `/home/yasharf/Workspace/AsusWRT/asuswrt-merlin/release/src/router/libxml2'
CDPATH="${ZSH_VERSION+.}:" && cd . && autoconf
 cd . && automake-1.14 --gnu
automake-1.14: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
/bin/bash ./config.status --recheck
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:1022: _LT_SYS_MODULE_PATH_AIX is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
configure.in:69: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
m4/libtool.m4:4161: _LT_LINKER_SHLIBS is expanded from...
m4/libtool.m4:5236: _LT_LANG_C_CONFIG is expanded from...
m4/libtool.m4:138: _LT_SETUP is expanded from...
m4/libtool.m4:67: LT_INIT is expanded from...
m4/libtool.m4:103: AM_PROG_LIBTOOL is expanded from...
configure.in:69: the top level
running CONFIG_SHELL=/bin/bash /bin/bash ././configure --host=mipsel-linux --build= --prefix=/usr --without-python --disable-dependency-tracking build_alias= host_alias=mipsel-linux CC=mipsel-uclibc-gcc CFLAGS=-Os -Wall -DLINUX26 -DCONFIG_BCMWL5 -DDEBUG_NOISY -DDEBUG_RCTEST -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32r2 -mips32r2 -DLINUX_KERNEL_VERSION=132630  LDFLAGS=-ldl --no-create --no-recursion
configure.in:50: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.in:50: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.in:53: error: required file './compile' not found
configure.in:53:   'automake --add-missing' can install 'compile'
Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
automake-1.14: warning: autoconf input should be named 'configure.ac', not 'configure.in'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... mipsel-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/yasharf/Workspace/AsusWRT/asuswrt-merlin/release/src/router/libxml2/missing: Unknown `--is-lightweight' option
Try `/home/yasharf/Workspace/AsusWRT/asuswrt-merlin/release/src/router/libxml2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
victor-rds commented 9 years ago

@assarbad no, you need to add a single line in asuswrt-merlin/release/src/router/Makefile the target libxml2/stamp-h1 should look like this:

libxml2/stamp-h1:
        cd libxml2 && \
        CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" LDFLAGS=-ldl \
        ./$(CONFIGURE) --prefix=/usr --without-python --disable-dependency-tracking
        cd libxml2 && automake --add-missing
        touch $@

the only change is the cd libxml2 && automake --add-missing And although worked, I'm not sure if this is solution or just a workaround. Just to mention I'm building on Ubuntu 15.04 64-bit

YasharF commented 9 years ago

I'm wondering, should this be a patch submitted to asuswrt-merlin instead of build-asuswrt-merlin, or is the issue only when build-asuswrt-merlin is used?

victor-rds commented 9 years ago

@YasharF I'm wondering that too, and to be honest I only posted here because it was the first place I found same issue as mine.

assarbad commented 9 years ago

Not a big deal, this script already patches up various things, I can add it here and keep it in a defensive coding style ... e.g. using patch ... so that if upstream fixes this, the script won't mess it up once again, for example ;)

Thanks to both of you for the feedback, time to adjust the script a little more, I think ... and run a few test builds to see that it works.

YasharF commented 9 years ago

Just checking to see if you had a chance to do the test builds.

jaycyb commented 8 years ago

+1 @victor-rds thanks that worked!

hadjedjvincent commented 8 years ago

I've used this to make it works (Debian 7) :

libxml2/stamp-h1:
        cd libxml2 && \
        CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) CFLAGS="-Os -Wall $(EXTRACFLAGS)" LDFLAGS=-ldl \
        ./$(CONFIGURE) --prefix=/usr --without-python --disable-dependency-tracking
        cd libxml2 && libtoolize && aclocal && autoheader && automake --add-missing
        touch $@