httpServer example run problem

Hi!
I try to run example of httpServer on my WP8548 (16.10.4).
I make lighttpd (1.4.49) as described in readme:

Run these:

$ CCFLAGS="-DDEBUG -g" CC=$WP85_TOOLCHAIN_DIR/arm-poky-linux-gnueabi-gcc RANLIB=$WP85_TOOLCHAIN_DIR/arm-poky-linux-gnueabi-ranlib STRIP=WP85_TOOLCHAIN_DIR/arm-poky-linux-gnueabi-strip ./configure --host=arm-poky-linux --enable-static --enable-shared --without-zlib --without-bzip2 --without-pcre --without-openssl
$ make

Copy src/lighttpd to a binaries/ folder within the sample app directory (httpServer/binaries) and chmod +x
Copy src/.libs/*.so or whatever module libraries you need to httpServer/binaries/lib/

So no problem at this moment. I only configure lighttpd with key: --without-openssl.
Compile httpServer compile without problem (in adef file I only rename libcrypto.so.1.0.0 to libcrypt-2.20.so).
So than I install application on the device at the end I have this:

Jan 6 00:17:01 | supervisor[483]/supervisor T=main | proc.c proc_Start() 1190 | Starting process ‘lighttpd’ with pid 3806
Jan 6 00:17:01 | updateDaemon[509]/updateDaemon T=main | app.c app_InstallIndividual() 662 | App PowerControl <0f8f61f7c5cda21975a4362e2642b441> installed
Jan 6 00:17:01 | updateDaemon[509]/updateDaemon T=main | updateDaemon.c ApplyAppUpdate() 664 | App ‘PowerControl<0f8f61f7c5cda21975a4362e2642b441>’ installed properly.
Jan 6 00:17:01 | updateDaemon[509]/updateDaemon T=main | updateDaemon.c StartProbation() 190 | System on probation (timer started).
Jan 6 00:17:01 | supervisor[3806]/supervisor T=main | proc.c proc_Start() 1155 | Execing ‘lighttpd’
Jan 6 00:17:01 | avcDaemon[535]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 2982 | Creating asset instance for PowerControl/1
Jan 6 00:17:01 | avcDaemon[535]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 3079 | Finished creating instance 0 for PowerControl/1
Jan 6 00:17:01 | avcDaemon[535]/appCfg T=main | appCfg.c appCfg_GetProcFaultAction() 547 | Unrecognized fault action ‘’. Defaulting to fault action ‘ignore’.
Jan 6 00:17:01 | lighttpd[3806] | | /bin/sh:
Jan 6 00:17:01 | lighttpd[3806] | | can’t open '/usr/local/bin/lighttpd’
Jan 6 00:17:01 | lighttpd[3806] | |
Jan 6 00:17:01 | supervisor[483]/supervisor T=main | proc.c proc_SigChildHandler() 1942 | Process ‘lighttpd’ (PID: 3806) has exited with exit code 2.
Jan 6 00:17:01 | supervisor[483]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process ‘lighttpd’. Assuming ‘ignore’.
Jan 6 00:17:01 | supervisor[483]/supervisor T=main | app.c app_SigChildHandler() 3221 | Process ‘lighttpd’ in app ‘PowerControl’ faulted: Ignored.
Jan 6 00:17:01 | _appStopClient[3809]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
Jan 6 00:17:01 | supervisor[483]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘PowerControl’ has stopped.

So can anyone to help me because I cant sleep for 2 nights already.
Thanks!

So I compile lighttpd and copy via ssh to wp8548 and run it.

In version 1.4.49 I have answer:

lighttpd: line 1: can’t create $/lib64/ld-linux-x86-64.so.2GNUGNU´Du²sÙÇ­Bµ*Uàå›: nonexistent directory
lighttpd: line 1: ELF: not found
lighttpd: line 1: syntax error: unexpected word (expecting “)”)

In version 1.4.39:

lighttpd: line 1: ELF: not found
lighttpd: line 2: Ä: not found
lighttpd: line 3: can’t open üÎ#»7M‹²aÊ+Ujíjʼn: no such file
lighttpd: line 5: syntax error: unexpected “)”

After cross compile I run command in Ubuntu

file ./lighttpd
./lighttpd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=b44475b273d9c7eec28e951dad1942b52a55e0e5, with debug_info, not stripped

So I think that I compile lighttpd for X86 platform, but why?
I write here my commands to cross compile:

export TOOLCHAIN_DIR=/home/mangoh/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07121400-wp85-wp750x-native-x86_64-201712131256/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
export CCFLAGS=“-DDEBUG -g”
export CC=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-gcc
export RANLIB=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-ranlib
export STRIP=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-strip
sudo ./configure --host=arm-poky-linux --target=arm-poky-linux --enable-static --enable-shared --without-zlib --without-bzip2 --without-pcre --with-openssl --with-openssl-libs=/usr/lib
sudo make

Any suggestion?

I did it (for wp85 16.10.4). How to build lighttpd:
export TOOLCHAIN_DIR=/home/mangoh/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07121400-wp85-wp750x-native-x86_64-201712131256/resources/native/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
export CC=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-gcc
export RANLIB=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-ranlib
export STRIP=$TOOLCHAIN_DIR/arm-poky-linux-gnueabi-strip
export CFLAGS="-DDEBUG -g -lpthread --sysroot=/home/mangoh/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07121400-wp85-wp750x-native-x86_64-201712131256/resources/native/sysroots/armv7a-vfp-neon-poky-linux-gnueabi"
./configure --host=arm-poky-linux --enable-static --enable-shared --without-zlib --without-bzip2 --without-pcre --without-openssl --disable-ipv6
make

1 Like