OpenWrt Forum Archive

Topic: seafile on openWRT

The content of this topic has been archived on 30 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I intend to package seafile [1] for openWRT. Before I get my hands too dirty I wanted to ask

#1 if someone has already tried to package it (google did not tell much) and
#2 if there are any caveats in general when it comes to package python based applications for openWRT

seafile has already been produced for the RPi, so it should be doable for openWRT as well - I hope smile

[1] https://github.com/haiwen/seafile

udotirol wrote:

Hi,

I intend to package seafile [1] for openWRT

Any luck with this? I'm interested in trying Seafile out for openwrt

I'm also interested, and do some searches, but i haven't also luck.
But for self package i did some basic researches:

seafile Prerequisites (debian)      OpenWRT

python 2.6.5+ or 2.7                         python_2.7.3-2_ar71xx.ipk
python-setuptools                            -
python-simplejson                            -
python-imaging                                 python-imaging-library_1.1.7-2_ar71xx.ipk
sqlite3                                               -
dep:     libc0.1    / libc0.1-udeb         libc_0.9.33.2-1_ar71xx.ipk   
dep:     libc6    / libc6-udeb               -
dep:     libc6.1 / libc6.1-udeb            -
dep:     libreadline6                          libreadline_6.2-1_ar71xx.ipk 
dep:     libsqlite3-0                           libsqlite3_3080403-1_ar71xx.ipk

also interested...

I'm working on this currently, my intention is to create packages for the server components of Seafile. It looks to me I'll need to create 3 packages (maybe more in case there are any missing dependencies):

* libsearpc
* seafile-ccnet
* seafile-server

I'm facing an issue now that the compilation does not start for some reason without any error messages, hopefully it will be solved soon so I can go on with the packaging process:

https://forum.openwrt.org/viewtopic.php?pid=254761

I could successfully make 4 packages already:

* libsearpc
* libzdb
* seafile-ccnet
* vala (needed for building ccnet)

Only one more to go (seafile-server) so stay tuned! smile

Good jobs, you use the latest version of OpenWRT?

And finally, I'm done! smile

Seafile runs perfectly on my Netgear WNDR4300 router:

root@OpenWrt:/# IPKG_INSTROOT=/mnt/extroot opkg -d ext install seafile-server
Installing seafile-server (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-server_3.1.7-1_ar71xx.ipk.
Installing seafile-ccnet (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-ccnet_3.1.7-1_ar71xx.ipk.
Installing seafile-seahub (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-seahub_3.1.7-1_ar71xx.ipk.
Configuring seafile-ccnet.
*** Creating ccnet configuration...
*** NOTE: a default configuration has been created for ccnet in file /mnt/extroot/usr/share/seafile/ccnet/ccnet.conf
*** You may want to modify the NAME and SERVICE_URL parameters to match your requirements.
Configuring seafile-seahub.
*** Creating Seahub configuration...
Done.
*** Creating Seahub database...
Done.
*** Creating symlink for Seahub's avatar directory...
Done.
Configuring seafile-server.
*** Creating configuration...
Done.
*** Installation completed, your Seafile server should start up now automatically.

*** If this is the first time you installed Seafile, you'll need to create an administrative login.
*** To do so, please run the script "/mnt/extroot/usr/share/seafile/seafile-server/reset-admin.sh"

*** Once done, open the URL "http://<your_routers_ip_address>:8000/" in your browser to log in.
*** WARNING: this is a plain, unencrypted HTTP connection. To have secure access to your files, use HTTPS instead.
*** Please read http://manual.seafile.com/deploy/https_with_nginx.html to learn how to do that.

*** Enjoy using Seafile!
Seahub is not running
Done.

seafile server not running yet
Done.
Starting seafile server, please wait ...
Seafile server started

Done.
Starting seahub at port 8000 ...
Loading ccnet config from /mnt/extroot/usr/share/seafile/ccnet
Loading seafile config from /mnt/extroot/usr/share/seafile/seafile-data

Seahub is started

Done.

It took more than a week of hard work until I could fix all issues standing in my way but nevermind, at least I have it running now. smile

Some of the features:

* The build works with the latest stable release (3.1.7) of the Seafile components (seafile-server, ccnet, seahub) and the current stable branch (14.07) of openwrt (should work with HEAD, too but I need to test that)
* PID files are stored in a common directory within /var/run/seafile directory
* the installation script creates a dedicated user account for all seafile services, none of the components need root privileges
* python dependencies are automatically installed during the packaging process using python's "distribution" package
* all the generated packages can be safely installed to non-default installation roots (eg. an external USB drive or hard disk)

Now, I only need to fix some minor issues (eg. wrong server version displayed on Seahub) and make some tests to see how stable the installation can operate. After that, I will be more than happy to publish my work.

What's the correct way to do that? Shall I create a pull request to have my packages included in openwrt?

Thanks,
George

Can you then upload source code to github too? then we can use it, wait openwrt to merge may take long time.

geryhun wrote:

And finally, I'm done! smile

Seafile runs perfectly on my Netgear WNDR4300 router:

root@OpenWrt:/# IPKG_INSTROOT=/mnt/extroot opkg -d ext install seafile-server
Installing seafile-server (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-server_3.1.7-1_ar71xx.ipk.
Installing seafile-ccnet (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-ccnet_3.1.7-1_ar71xx.ipk.
Installing seafile-seahub (3.1.7-1) to ext...
Downloading file:///mnt/packages/seafile/seafile-seahub_3.1.7-1_ar71xx.ipk.
Configuring seafile-ccnet.
*** Creating ccnet configuration...
*** NOTE: a default configuration has been created for ccnet in file /mnt/extroot/usr/share/seafile/ccnet/ccnet.conf
*** You may want to modify the NAME and SERVICE_URL parameters to match your requirements.
Configuring seafile-seahub.
*** Creating Seahub configuration...
Done.
*** Creating Seahub database...
Done.
*** Creating symlink for Seahub's avatar directory...
Done.
Configuring seafile-server.
*** Creating configuration...
Done.
*** Installation completed, your Seafile server should start up now automatically.

*** If this is the first time you installed Seafile, you'll need to create an administrative login.
*** To do so, please run the script "/mnt/extroot/usr/share/seafile/seafile-server/reset-admin.sh"

*** Once done, open the URL "http://<your_routers_ip_address>:8000/" in your browser to log in.
*** WARNING: this is a plain, unencrypted HTTP connection. To have secure access to your files, use HTTPS instead.
*** Please read http://manual.seafile.com/deploy/https_with_nginx.html to learn how to do that.

*** Enjoy using Seafile!
Seahub is not running
Done.

seafile server not running yet
Done.
Starting seafile server, please wait ...
Seafile server started

Done.
Starting seahub at port 8000 ...
Loading ccnet config from /mnt/extroot/usr/share/seafile/ccnet
Loading seafile config from /mnt/extroot/usr/share/seafile/seafile-data

Seahub is started

Done.

It took more than a week of hard work until I could fix all issues standing in my way but nevermind, at least I have it running now. smile

Some of the features:

* The build works with the latest stable release (3.1.7) of the Seafile components (seafile-server, ccnet, seahub) and the current stable branch (14.07) of openwrt (should work with HEAD, too but I need to test that)
* PID files are stored in a common directory within /var/run/seafile directory
* the installation script creates a dedicated user account for all seafile services, none of the components need root privileges
* python dependencies are automatically installed during the packaging process using python's "distribution" package
* all the generated packages can be safely installed to non-default installation roots (eg. an external USB drive or hard disk)

Now, I only need to fix some minor issues (eg. wrong server version displayed on Seahub) and make some tests to see how stable the installation can operate. After that, I will be more than happy to publish my work.

What's the correct way to do that? Shall I create a pull request to have my packages included in openwrt?

Thanks,
George

maplewang wrote:

Can you then upload source code to github too? then we can use it, wait openwrt to merge may take long time.

I'd love to do so but in the meantime I've found a major issue with file uploads regarding the "fileserver" component which is only reproducible on openwrt (the same code works fine when compiled and run on the host PC). It's hard to tell now what the problem is (maybe some thread-safety bug?), I'm doing my best to debug and fix it...

I need to inspect the code with gdb to find where things go wrong and then create a fix if possible. Let's hope it won't take too long...

(Last edited by geryhun on 3 Dec 2014, 23:35)

I'd love to do so but

Other ppl might help you to debug the problem - but maybe they dont have the skill or time to create an OpenWrt package (or to read documentation how to use OpenWrt buildroot...)

which is only reproducible on openwrt (the same code works fine when compiled and run on the host PC)

Just as a guideline:
- check different compiler (4.6 and 4.9 are available and should generate working images too)
- check MIPS16/disable it (4.6 did not have MIPS16; there are compiler errors with MIPS16 on many packages)
- check compiler options: OpenWrt uses "-Os" - compile on your PC with the same flag/compile OpenWrt/package with different flags (override TARGET_CFLAGS in Makefile or other CFLAGS - menuconfig has some option)
- check x86/x86_64 code generation in a VM

Having a quick look at upstream code in configure.ac:
I wonder if the fileserver component has issues with cross-compilation. Maybe some RPATH thing is wrong - maybe the configure generated from configure.ac is has some cross compile bugs
Cross compile bugs are more likely on new software (because most ppl do not do cross compilations)

zloop wrote:

I'd love to do so but

Other ppl might help you to debug the problem - but maybe they dont have the skill or time to create an OpenWrt package (or to read documentation how to use OpenWrt buildroot...)

which is only reproducible on openwrt (the same code works fine when compiled and run on the host PC)

Just as a guideline:
- check different compiler (4.6 and 4.9 are available and should generate working images too)
- check MIPS16/disable it (4.6 did not have MIPS16; there are compiler errors with MIPS16 on many packages)
- check compiler options: OpenWrt uses "-Os" - compile on your PC with the same flag/compile OpenWrt/package with different flags (override TARGET_CFLAGS in Makefile or other CFLAGS - menuconfig has some option)
- check x86/x86_64 code generation in a VM

Having a quick look at upstream code in configure.ac:
I wonder if the fileserver component has issues with cross-compilation. Maybe some RPATH thing is wrong - maybe the configure generated from configure.ac is has some cross compile bugs
Cross compile bugs are more likely on new software (because most ppl do not do cross compilations)

Thanks for your feedback, zloop, much appreciated!

I'm going to try to upload my work to Github now, will share the link soon in a separate post.

In the meantime, I've been working on setting up extroot with a USB stick on my Netgear WNDR4300. My plan was to install the packages generated to / (root) instead of a separate directory (which is said to often causes problems with some software) but I couldn't find a way to do that, so far... it's slowly driving me mad, even though I set up everything as per the wiki article says and try all the tweaks possible, the rootfs still remains on flash and I get no related messages in dmesg or logread to see what's wrong, it's like openwrt silently ignores if I try to mount anything to / or /overlay.

On the other hand, if I try to compile my packages with debugging information included (set up as suggested here: http://wiki.openwrt.org/doc/devel/gdb) then all packages depending on libpthread fail at configure time. The error message says that libpthread is not installed while the libraries and header files seem to be properly installed. Interestingly, the same source and package configuration works fine if I disable debugging capabilities. What am I missing here?

Let's hope some more experienced guys can help me with this as I'm slowly getting out of ideas and it makes me really said that I run into thick walls after so many hours of hard work I already put into this.

Luckily, I'll be on holiday next week so will have a lot of time to work on finishing the port.

(Last edited by geryhun on 6 Dec 2014, 01:31)

This definitely will be an issue with libevhtp or one of its dependencies.

Here's the build log:

make[1]: Entering directory `/home/nb/openwrt_build/barrier_breaker'
make[2]: Entering directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
rm -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.libevhtp_installed
make[2]: [clean-staging] Error 123 (ignored)
rm -f /home/nb/openwrt_build/barrier_breaker/bin/ar71xx/packages/seafile/libevhtp_*
rm -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages/libevhtp.list /home/nb/openwrt_build/barrier_breaker/staging_dir/host/packages/libevhtp.list
rm -rf /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9
make[2]: Leaving directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
make[1]: Leaving directory `/home/nb/openwrt_build/barrier_breaker'
make[1]: Entering directory `/home/nb/openwrt_build/barrier_breaker'
make[2]: Entering directory `/home/nb/openwrt_build/barrier_breaker/package/libs/toolchain'
if [ -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install
if [ -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install
WARNING: skipping libssp -- package not selected
WARNING: skipping libstdcpp -- package not selected
WARNING: skipping libthread-db -- package not selected
WARNING: skipping librt -- package not selected
WARNING: skipping libgfortran -- package not selected
WARNING: skipping ldd -- package not selected
WARNING: skipping ldconfig -- package not selected
make[2]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/package/libs/toolchain'
make[2]: Entering directory `/home/nb/openwrt_build/barrier_breaker/package/libs/ocf-crypto-headers'
make[2]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/package/libs/ocf-crypto-headers'
make[2]: Entering directory `/home/nb/openwrt_build/barrier_breaker/package/libs/zlib'
make[2]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/package/libs/zlib'
make[2]: Entering directory `/home/nb/openwrt_build/barrier_breaker/package/libs/openssl'
WARNING: skipping openssl-util -- package not selected
make[2]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/package/libs/openssl'
make[2]: Entering directory `/home/nb/openwrt_build/barrier_breaker/package/libs/libevent2'
WARNING: skipping libevent2-core -- package not selected
WARNING: skipping libevent2-extra -- package not selected
make[2]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/package/libs/libevent2'
make[2]: Entering directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
mkdir -p /home/nb/openwrt_build/barrier_breaker/dl
/home/nb/openwrt_build/barrier_breaker/scripts/download.pl "/home/nb/openwrt_build/barrier_breaker/dl" "1.2.9.tar.gz" "428a8d179fcc0cadedd914ed6456e08f" "[url]https://github.com/ellzey/libevhtp/archive/[/url]"
--2014-12-07 00:39:33--  [url]https://github.com/ellzey/libevhtp/archive/1.2.9.tar.gz[/url]
Resolving github.com (github.com)... 192.30.252.130
Connecting to github.com (github.com)|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [url]https://codeload.github.com/ellzey/libevhtp/tar.gz/1.2.9[/url] [following]
--2014-12-07 00:39:34--  [url]https://codeload.github.com/ellzey/libevhtp/tar.gz/1.2.9[/url]
Resolving codeload.github.com (codeload.github.com)... 192.30.252.146
Connecting to codeload.github.com (codeload.github.com)|192.30.252.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: 'STDOUT'

     0K .......... .......... .......... .......... ..........  189K
    50K .......... .......... .......... .......... ..........  239K
   100K .......... .......... .......... .......... ..........  556K
   150K .......... .......... .......... .......... ..........  392K
   200K .......... .......... .......... .......... ..........  498K
   250K .......... .......... .......... .......... .......... 1.37M
   300K .......... .......... .......... .......... ..........  531K
   350K ..                                                     7.41M=0.9s

2014-12-07 00:39:35 (382 KB/s) - written to stdout [360647]

. /home/nb/openwrt_build/barrier_breaker/include/shell.sh; gzip -dc /home/nb/openwrt_build/barrier_breaker/dl/1.2.9.tar.gz | /usr/bin/gtar -C /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/.. -xf - 

Applying ./patches/010-enable-shared-object-building.patch using plaintext: 
patching file CMakeLists.txt
# deleting source package as its filename is ambiguous
rm -f /home/nb/openwrt_build/barrier_breaker/dl/1.2.9.tar.gz
touch /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/.prepared_895b0ef5991be76b2fc80e73eb53c87d
(cd /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9; CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 " LDFLAGS="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=mips -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_C_COMPILER="/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc" -DCMAKE_C_COMPILER_ARG1="" -DCMAKE_CXX_COMPILER="/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-g++" -DCMAKE_CXX_COMPILER_ARG1="" -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib" -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib" -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib" -DCMAKE_AR="/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-ar" -DCMAKE_RANLIB="/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-ranlib" -DCMAKE_FIND_ROOT_PATH="/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2;/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/usr -DDL_LIBRARY=/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2 -DCMAKE_PREFIX_PATH=/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2  . )
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc
-- Check for working C compiler: /home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-g++
-- Check for working CXX compiler: /home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for memcmp
-- Looking for memcmp - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for include file alloca.h
-- Looking for include file alloca.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/times.h
-- Looking for include file sys/times.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file stdarg.h
-- Looking for include file stdarg.h - found
-- Looking for include file sys/tree.h
-- Looking for include file sys/tree.h - not found
-- Looking for include file sys/queue.h
-- Looking for include file sys/queue.h - found
-- Looking for include file sys/un.h
-- Looking for include file sys/un.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of short
-- Check size of short - done
Build Type: Release
Std CFLAGS: -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16   -Wall -fno-strict-aliasing -DPROJECT_VERSION="1.2.9" -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112
Dbg CFLAGS: -g -Wall -fno-strict-aliasing -ggdb
Rel CFLAGS: -DNDEBUG -Wall -fno-strict-aliasing
-- Found LibEvent: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libevent.so  
-- Found LibEventPthreads: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libevent_pthreads.so  
-- Found LibEventCore: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libevent_core.so  
-- Found LibEventExtra: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libevent_extra.so  
-- Found LibEventOpenssl: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libevent_openssl.so  
-- Found OpenSSL: /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libssl.so;/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libcrypto.so (found version "1.0.1j") 
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_MODULE_LINKER_FLAGS
    DL_LIBRARY


-- Build files have been written to: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9
rm -f /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/.configured_
touch /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/.configured_
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16  -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16  -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " make -j1 -C /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[3]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[4]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[5]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
Scanning dependencies of target libevhtp
make[5]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[5]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
[  2%] Building C object CMakeFiles/libevhtp.dir/evhtp.c.o
[  4%] Building C object CMakeFiles/libevhtp.dir/htparse/htparse.c.o
[  6%] Building C object CMakeFiles/libevhtp.dir/evthr/evthr.c.o
[  8%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regerror.c.o
[ 10%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regparse.c.o
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c: In function 'fetch_escaped_value':
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:252:30: warning: variable 'pfetch_prev' set but not used [-Wunused-but-set-variable]
 #define PFETCH_READY  UChar* pfetch_prev
                              ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:2407:3: note: in expansion of macro 'PFETCH_READY'
   PFETCH_READY;
   ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c: In function 'fetch_name':
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:252:30: warning: variable 'pfetch_prev' set but not used [-Wunused-but-set-variable]
 #define PFETCH_READY  UChar* pfetch_prev
                              ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:2620:3: note: in expansion of macro 'PFETCH_READY'
   PFETCH_READY;
   ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c: In function 'parse_posix_bracket':
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:252:30: warning: variable 'pfetch_prev' set but not used [-Wunused-but-set-variable]
 #define PFETCH_READY  UChar* pfetch_prev
                              ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:3938:3: note: in expansion of macro 'PFETCH_READY'
   PFETCH_READY;
   ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c: In function 'fetch_char_property_to_ctype':
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:252:30: warning: variable 'pfetch_prev' set but not used [-Wunused-but-set-variable]
 #define PFETCH_READY  UChar* pfetch_prev
                              ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:3991:3: note: in expansion of macro 'PFETCH_READY'
   PFETCH_READY;
   ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c: In function 'code_exist_check':
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:252:30: warning: variable 'pfetch_prev' set but not used [-Wunused-but-set-variable]
 #define PFETCH_READY  UChar* pfetch_prev
                              ^
/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/oniguruma/regparse.c:4156:3: note: in expansion of macro 'PFETCH_READY'
   PFETCH_READY;
   ^
[ 13%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regext.c.o
[ 15%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regcomp.c.o
[ 17%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regexec.c.o
[ 19%] Building C object CMakeFiles/libevhtp.dir/oniguruma/reggnu.c.o
[ 21%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regenc.c.o
[ 23%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regsyntax.c.o
[ 26%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regtrav.c.o
[ 28%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regversion.c.o
[ 30%] Building C object CMakeFiles/libevhtp.dir/oniguruma/st.c.o
[ 32%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regposix.c.o
[ 34%] Building C object CMakeFiles/libevhtp.dir/oniguruma/regposerr.c.o
[ 36%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/unicode.c.o
[ 39%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/ascii.c.o
[ 41%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/utf8.c.o
[ 43%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/utf16_be.c.o
[ 45%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/utf16_le.c.o
[ 47%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/utf32_be.c.o
[ 50%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/utf32_le.c.o
[ 52%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/euc_jp.c.o
[ 54%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/sjis.c.o
[ 56%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_1.c.o
[ 58%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_2.c.o
[ 60%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_3.c.o
[ 63%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_4.c.o
[ 65%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_5.c.o
[ 67%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_6.c.o
[ 69%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_7.c.o
[ 71%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_8.c.o
[ 73%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_9.c.o
[ 76%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_10.c.o
[ 78%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_11.c.o
[ 80%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_13.c.o
[ 82%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_14.c.o
[ 84%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_15.c.o
[ 86%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/iso8859_16.c.o
[ 89%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/euc_tw.c.o
[ 91%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/euc_kr.c.o
[ 93%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/big5.c.o
[ 95%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/gb18030.c.o
[ 97%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/koi8_r.c.o
[100%] Building C object CMakeFiles/libevhtp.dir/oniguruma/enc/cp1251.c.o
Linking C shared library libevhtp.so
make[5]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
[100%] Built target libevhtp
make[4]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[3]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16  -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16  -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/lib -L/home/nb/openwrt_build/barrier_breaker/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib " make -C /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -g3 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" DESTDIR="/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install"  install;
make[3]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[4]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[5]: Entering directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
make[5]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
[100%] Built target libevhtp
make[4]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
Install the project...
-- Install configuration: "Release"
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/lib/libevhtp.so
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/evhtp.h
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/htparse.h
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/evhtp-config.h
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/evthr.h
-- Installing: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/onigposix.h
make[3]: Leaving directory `/home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9'
touch /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/.built
mkdir -p /home/nb/openwrt_build/barrier_breaker/bin/ar71xx/packages /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/CONTROL /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo
install -d -m0755 /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/usr/lib
cp -fpR /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/lib/libevhtp.so* /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/usr/lib/
find /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
: /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp
( echo "Package: libevhtp"; echo "Version: 1.2.9-1"; DEPENDS=''; for depend in libc libevent2 libevent2-openssl libevent2-pthreads libpthread; do DEPENDS=${DEPENDS:+$DEPENDS, }${depend##+}; done; [ -z "$DEPENDS" ] || echo "Depends: $DEPENDS";  echo "Source: /home/nb/openwrt_build/seafile/libs/libevhtp";  echo "License: BSD-3-Clause";   echo "Section: libs";   echo "Maintainer: Gergely Kiss <mail.gery@gmail.com>";  echo "Architecture: ar71xx"; echo "Installed-Size: 0"; echo -n "Description: "; . /home/nb/openwrt_build/barrier_breaker/include/shell.sh; getvar V_Package_libevhtp_description | sed -e 's,^[[:space:]]*, ,g'; ) > /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/CONTROL/control
chmod 644 /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/CONTROL/control
. /home/nb/openwrt_build/barrier_breaker/include/shell.sh; (cd /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp/CONTROL;  )
install -d -m0755 /home/nb/openwrt_build/barrier_breaker/bin/ar71xx/packages/seafile
ipkg-build -c -o 0 -g 0 /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp /home/nb/openwrt_build/barrier_breaker/bin/ar71xx/packages/seafile
Packaged contents of /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-ar71xx/libevhtp into /home/nb/openwrt_build/barrier_breaker/bin/ar71xx/packages/seafile/libevhtp_1.2.9-1_ar71xx.ipk
rm -rf /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp
mkdir -p /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/stamp /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp
install -d -m0755 /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp/usr/lib
cp -fpR /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/lib/libevhtp.so* /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp/usr/lib/
SHELL= /home/nb/openwrt_build/barrier_breaker/staging_dir/host/bin/flock /home/nb/openwrt_build/barrier_breaker/tmp/.root-copy.flock -c 'cp -fpR /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp/. /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/'
rm -rf /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-libevhtp
touch /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/stamp/.libevhtp_installed
make V=ss  -j1 clean-staging
make[3]: Entering directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
rm -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.libevhtp_installed
make[3]: Leaving directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
rm -rf /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp
mkdir -p /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp/host /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages /home/nb/openwrt_build/barrier_breaker/staging_dir/host/packages
install -d -m0755 /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp/usr/{include,lib}
cp -fpR /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/include/* /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp/usr/include/
cp -fpR /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/ipkg-install/usr/lib/libevhtp.so* /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp/usr/lib/
find /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp -name '*.la' | xargs -r rm -f; 
if [ -f /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages/libevhtp.list ]; then /home/nb/openwrt_build/barrier_breaker/scripts/clean-package.sh "/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages/libevhtp.list" "/home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2"; fi
if [ -d /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp ]; then (cd /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp; find ./ > /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp.files);     SHELL= /home/nb/openwrt_build/barrier_breaker/staging_dir/host/bin/flock /home/nb/openwrt_build/barrier_breaker/tmp/.staging-dir.flock -c ' mv /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp.files /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/packages/libevhtp.list && cp -fpR /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp/* /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/; '; fi
rm -rf /home/nb/openwrt_build/barrier_breaker/tmp/stage-libevhtp
touch /home/nb/openwrt_build/barrier_breaker/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.libevhtp_installed
make[2]: Leaving directory `/home/nb/openwrt_build/seafile/libs/libevhtp'
make[1]: Leaving directory `/home/nb/openwrt_build/barrier_breaker'

Please someone take a look at it.

After doing a little bit of debugging, I could see that in file-upload.c:2017 (fileserver binary of seafile-server), the execution does not hit the condition when it should because the HTTP request's type matches (it's an OPTIONS request sent by my browser). Instead, code execution continues and returns "400 Bad Request" HTTP response in the end.

Here are some interesting output of gdb:

(gdb) b upload-file.c:2017
Breakpoint 1 at 0x409134: file upload-file.c, line 2017.
(gdb) c
Continuing.
[New Thread 7388]
[Switching to Thread 7388]

Breakpoint 1, upload_headers_cb (req=0x545638, hdr=0x56cbf8, arg=0x0)
    at upload-file.c:2017
2017        if (evhtp_request_get_method(req) == htp_method_OPTIONS) {
(gdb) s
evhtp_request_get_method (r=0x545638)
    at /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/evhtp.c:1972
1972        return htparser_get_method(r->conn->parser);
(gdb) s
htparser_get_method (p=0x56e600)
    at /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/htparse/htparse.c:375
375    }
(gdb) s
evhtp_request_get_method (r=0x545638)
    at /home/nb/openwrt_build/barrier_breaker/build_dir/target-mips_34kc_uClibc-0.9.33.2/libevhtp-1.2.9/evhtp.c:1973
1973    }
(gdb) s
upload_headers_cb (req=0x545638, hdr=<optimized out>, arg=<optimized out>)
    at upload-file.c:2022
2022        token = req->uri->path->file;

Any ideas?

Could someone please compile the packages and check if it works like that even if all packages are installed to root (I can't try that as extroot doesn't work on my router model)?

Finally, I found the culprit!

At libevhtp's htparse.c:200, there are some compiler macros defined to do string comparisons:

#define _str3_cmp(m, c0, c1, c2, c3) \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)

#define _str3Ocmp(m, c0, c1, c2, c3) \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)

#define _str4cmp(m, c0, c1, c2, c3) \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)

#define _str5cmp(m, c0, c1, c2, c3, c4)                          \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
    && m[4] == c4

#define _str6cmp(m, c0, c1, c2, c3, c4, c5)                      \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
    && (((uint32_t *)m)[1] & 0xffff) == ((c5 << 8) | c4)

#define _str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7)             \
    *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
    && ((uint32_t *)m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4)

This does not work for some reason, I could see during a debugging session that the function does not find the match when it should:

[...]
(gdb) n
490            switch (p->state) {
(gdb) n
544                    if (ch == ' ') {
(gdb) n
545                        char * m = p->buf;
(gdb) n
547                        switch (p->buf_idx) {
(gdb) p m
$12 = 0xa86084 "OPTIONS"
(gdb) n
616                                if (_str7_cmp(m, 'O', 'P', 'T', 'I', 'O', 'N', 'S', '\0')) {
(gdb) n
620                                if (_str7_cmp(m, 'C', 'O', 'N', 'N', 'E', 'C', 'T', '\0')) {

Taking a closer look at the issue, I suddenly realized that the platform I'm compiling for is big-endian by default and the comparison functions are utilizing bitshift operators...

So, I just need to patch the code to do the comparison with respect to endianness and then it should work as expected.

Jeez, this was such a hard nut to crack! big_smile

(Last edited by geryhun on 9 Dec 2014, 01:54)

Hi,

thanks for your efforts. I would really like to install this on my tplink router!

Any news on porting this to Chaos Chalmer? seafile-seahub and -ccnet are in the repositories, but I couldn't find seafile-server. Do you think the source would compile also for the latest release? I would be happy to test this on a mpc85xx platform, but haven't tried to compile anything myself yet (for openwrt, that is).

I guess developing for openwrt can be quite frustrating, maybe this a dead end anyway.

Any comments or help appreciated!
Stefan

nexkat wrote:

Hi,

thanks for your efforts. I would really like to install this on my tplink router!

Any news on porting this to Chaos Chalmer? seafile-seahub and -ccnet are in the repositories, but I couldn't find seafile-server. Do you think the source would compile also for the latest release? I would be happy to test this on a mpc85xx platform, but haven't tried to compile anything myself yet (for openwrt, that is).

I guess developing for openwrt can be quite frustrating, maybe this a dead end anyway.

Any comments or help appreciated!
Stefan

Hi Stefan,

unfortunately, package definitions in the development branch have been broken for a long time now, therefore the main package (seafile-server) didn't get included in Chaos Calmer. sad

I've already published my work upgrading seafile and adding it to the development branch, but it hasn't been merged yet:

https://github.com/openwrt/packages/pull/2651

If you are very eager to test the new version, feel free to build a custom image using my fork of the packages repo:

https://github.com/kissg1988/packages/tree/seafile

Actually, it builds well with Chaos Calmer, too, although it's not thoroughly tested so results may vary:

https://github.com/kissg1988/packages/tree/for-15.05

Regards,
Gergely

(Last edited by geryhun on 14 Jun 2016, 17:03)

The discussion might have continued from here.