Error building nginx and OpenSSL - c++

I’m trying to build the latest nginx version with the latest OpenSSL. The build process exits with the following message.
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[4]: *** [link_app.] Error 1
make[4]: Leaving directory `/tmp/openssl-1.0.1e/test'
make[3]: *** [md2test] Error 2
make[3]: Leaving directory `/tmp/openssl-1.0.1e/test'
make[2]: *** [build_tests] Error 1
make[2]: Leaving directory `/tmp/openssl-1.0.1e'
make[1]: *** [/tmp/openssl-1.0.1e/.openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory `/tmp/nginx-1.4.0'
make: *** [build] Error 2
My nginx configure call looks like the following:
./configure
--prefix=/usr/local
--sbin-path=/usr/local/sbin
--conf-path=/etc/nginx/nginx.conf
--pid-path=/var/run/nginx.pid
--lock-path=/var/lock/nginx.lock
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/dev/shm/nginx/client-body/tmp
--http-fastcgi-temp-path=/dev/shm/nginx/fastcgi/tmp
--with-pcre=/tmp/pcre-8.32
--with-openssl=/tmp/openssl-1.0.1e
--with-zlib=/tmp/zlib
--with-cc-opt='-O3 -m64'
--with-ld-opt='-m64'
--with-ipv6
--with-http_gzip_static_module
--with-http_ssl_module
--with-http_spdy_module
--with-md5=/tmp/openssl-1.0.1e
--with-md5-asm
--with-sha1=/tmp/openssl-1.0.1e
--with-sha1-asm
--with-pcre-jit
--without-http_autoindex_module
--without-http_auth_basic_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_conn_module
--without-http_limit_req_module
--without-http_map_module
--without-http_memcached_module
--without-http_proxy_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_upstream_ip_hash_module
--without-http_userid_module
--without-http_uwsgi_module
--without-mail_pop3_module
--without-mail_imap_module
--without-mail_smtp_module
--add-module=/tmp/nginx-upload-progress-module
--add-module=/tmp/nginx-upstream-fair
I know that this is some kind of gcc linker problem and I already tried several -lxxx flags (got them from other StackOverflow threads that were similar to my problem) but nothing helps. I also tried it with older nginx / OpenSSL versions, but no luck. Same goes for leaving the -O3 or -m64 compiler flags.
Some more info on the environment:
gcc (Debian 4.7.2-5) 4.7.2
cpp (Debian 4.7.2-5) 4.7.2
pcre 8.32
zlib and modules are cloned from git master

Finally I was able to compile nginx and of course I'd like to share this with you. Seems like the order of the configure options was the problem. I used the following configure argument order and it compiled without any problems.
nginx version: nginx/1.4.0
built by gcc 4.7.2 (Debian 4.7.2-5)
TLS SNI support enabled
configure arguments:
--user=www-data
--group=www-data
--prefix=/usr/local
--sbin-path=/usr/local/sbin
--conf-path=/etc/nginx/nginx.conf
--pid-path=/var/run/nginx.pid
--lock-path=/var/lock/nginx.lock
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/dev/shm/nginx/client-body/tmp
--http-fastcgi-temp-path=/dev/shm/nginx/fastcgi/tmp
--with-ipv6
--with-http_gzip_static_module
--with-http_ssl_module
--with-http_spdy_module
--with-openssl=/usr/local/src/nginx/openssl-1.0.1e
--with-md5=/usr/local/src/nginx/openssl-1.0.1e
--with-md5-asm
--with-sha1=/usr/local/src/nginx/openssl-1.0.1e
--with-sha1-asm
--with-pcre=/usr/local/src/nginx/pcre-8.32
--with-pcre-jit
--with-zlib=/usr/local/src/nginx/zlib
--without-http_autoindex_module
--without-http_auth_basic_module
--without-http_browser_module
--without-http_geo_module
--without-http_limit_conn_module
--without-http_limit_req_module
--without-http_map_module
--without-http_memcached_module
--without-http_proxy_module
--without-http_referer_module
--without-http_scgi_module
--without-http_split_clients_module
--without-http_ssi_module
--without-http_upstream_ip_hash_module
--without-http_userid_module
--without-http_uwsgi_module
--without-mail_pop3_module
--without-mail_imap_module
--without-mail_smtp_module
--add-module=/usr/local/src/nginx/nginx-upload-progress-module
--add-module=/usr/local/src/nginx/nginx-upstream-fair

Related

FingerJetFXOSE Cygwin compilation error

Can someone help me, Im having problem in compiling FingerJetFXOSE in Cygwin 32
gcc version 5.4.0 (GCC)
I used the following command:
$ make -f Makefile
make -C src/libFRFXLL
make[1]: Entering directory '/home/src/FingerJetFXOSE-master/src/libFRFXLL'
make -C src/libFRFXLL
make[2]: Entering directory '/home/src/FingerJetFXOSE- master/src/libFRFXLL/src/libFRFXLL'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/src/FingerJetFXOSE-master/src/libFRFXLL/src/libFRFXLL'
make[1]: Leaving directory '/home/src/FingerJetFXOSE-master/src/libFRFXLL'
make -C src/libfjfx
make[1]: Entering directory '/home/src/FingerJetFXOSE-master/src/libfjfx'
g++ -O2 -Wl,--strip-all -I../../include -I../libFRFXLL/include -fno- exceptions-fno-rtti -fno-stack-protector -fPIC -shared -nodefaultlibs -Wl,--version-script
I got this error at the end:
../libFRFXLL/lib/libFRFXLL.a(FRFXLLCreateFeatureSetInPlaceFromRaw.o):FRFXLLCreat
eFeatureSetInPlaceFromRaw.cpp:(.text$_ZN14FingerJetFxOSE15FpRecEngineImpl20Featu
reExtractionObjINS0_8Embedded24FeatureExtractionInPlaceEE16CreateFeatureSetIhEEi
PT_jjjjjPPv[__ZN14FingerJetFxOSE15FpRecEngineImpl20FeatureExtractionObjINS0_8Emb
edded24FeatureExtractionInPlaceEE16CreateFeatureSetIhEEiPT_jjjjjPPv]+0x159c): un
defined reference to `memmove'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:62: ../../lib/libfjfx.so.5.2.0] Error 1
make[1]: Leaving directory '/home/usr/FingerJetFXOSE-master/src/libfjfx'
make: *** [Makefile:50: src/libfjfx] Error 2
Thanks
I looked at the makefiles for the FingerJetFXOSE project here:
https://github.com/FingerJetFXOSE/FingerJetFXOSE
The makefiles do not support Cygwin. The README says that Windows is supported, but I suspect they mean a Visual-Studio-based build after a manual source import.
I think you either have to compile on GNU/Linux, or compile this code without the upstream makefiles.

Linking library with gcc - ld: cannot find -larpack

I am installing software on a server with no root privileges. I come across the following error during installation:
make[1]: *** [hgaprec] Error 1
make[1]: Leaving directory `/seq/.../SOFTWARE/hgaprec/src'
make: *** [all-recursive] Error 1
Making install in src
make[1]: Entering directory `/seq/.../SOFTWARE/hgaprec/src'
g++ -O3 -o hgaprec ratings.o main.o log.o hgaprec.o -larpack -llapack -
lblas -lgsl -lpthread -lgslcblas
/.../software/free/Linux/redhat_6_x86_64/pkgs/gcc_5.2.0/bin/ld: cannot
find -larpack
collect2: error: ld returned 1 exit status
make[1]: *** [hgaprec] Error 1
make[1]: Leaving directory `/seq/.../SOFTWARE/hgaprec/src'
make: *** [install-recursive] Error 1
Since library arpack could not be found, I then installed it here /seq/.../SOFTWARE/hgaprec/ARPACK and found that the process generated a static file libarpack_LINUX.a. To link this static library to gcc the following command was used:
gcc -larpack -L/seq/.../SOFTWARE/hgaprec/ARPACK/libarpack_LINUX.a
However, I keep getting the same error while installation of the software that larpack was not found. Am I using the linking command wrong?
You either want gcc main.c /seq/../SOFTWARE/hgaprec/ARPACK/libarpack_LINUX.a (you don't need -l and -L if you're specifying the full path to static library), or as #Julian_Cienfuegos suggested gcc main.c -L/seq/../SOFTWARE/hgaprec/ARPACK/ -larpack_LINUX. This assumes you're only compiling a single file called main.c which contains your main() function, and outputs the a.out binary.
EDIT: Added explanation of main.c.
My issue got solved after including the ARPACK library path as part of LD flag in configure like so:
./configure --prefix=/seq/.../SOFTWARE/hgaprec LDFLAGS="-L/seq/.../SOFTWARE/hgaprec/ARPACK/"

Coova-Chilli 1.3.0 build fails for Ubuntu server 14.04

Followed the directions from Coova-Chilli distribution build.
wget https://coova.github.io/coova-chilli/coova-chilli-1.3.0.tar.gz
tar xzf coova-chilli-1.3.0.tar.gz
cd coova-chilli-1.3.0/
debuild -b
and the results are the following error.
...........Error Section................
/usr/bin/ld: /usr/lib/libssl.a(s23_srvr.o): relocation R_X86_64_32 against
`.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
libtool: install: error: relink `libchilli.la' with the above command before
installing it
make[4]: *** [install-libLTLIBRARIES] Error 1
make[4]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/download/coova-chilli-1.3.0'
make: *** [install] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit
status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed
I initially thought maybe openssl was not a recent enough version. None of the other applications had that problem. So I removed openssl package, built and installed it from source. The latest version is openssl 1.0.2e. I retested radius server after ripping up and rebuilding openssl and all is surprisingly still working fine.
I tried to compile coova-chilli again and also 1.2.9 as well but received the same error. libssl.a is present in that location.
Any thoughts on how best to proceed?
The instructions for Debian/Ubuntu on Coova-Chilli were not correct for Ubuntu.
wget https://coova.github.io/coova-chilli/coova-chilli-1.3.0.tar.gz
tar xzf coova-chilli-1.3.0.tar.gz
cd coova-chilli-1.3.0/
./configure --prefix= --enable-miniportal (or whatever flags you want)
make
sudo make install
update-rc.d chilli defaults
Reference: https://help.ubuntu.com/community/WifiDocs/CoovaChilli

compilation of Qt 5 fails under make in debian64

I tried to make qt 5.4.1 with openSsl configuration but i got some errors during make it.
I configured it as bellow :
OPENSSL_LIBS='-L/usr/local/ssl/lib -lssl -lcrypto' ./configure -prefix $PWD/qtbase -opensource -debug-and-release -nomake tests -openssl-linked -I/usr/local/ssl/include -L/usr/local/ssl/lib
and then make.
the last 10 line of output is:
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_srvr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [../../lib/libQt5Network.so.5.4.1] Error 1
make[3]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase/src/network'
make[2]: *** [sub-network-make_first] Error 2
make[2]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase'
make: *** [module-qtbase-make_first] Error 2
To link a static library into a shared library on x86_64, the static library needs to be compiled with -fPIC. You could now build OpenSSL manually with -fPIC set, but that'd be a bit of a hassle.
I'd suggest to configure Qt with -openssl instead of -openssl-linked. Then SSL won't be linked at compile time but loaded dynamically (dlopen) at runtime. It's the usual way to handle OpenSSL in Qt, also because of the incompabilities between the OpenSSL and GPL licenses.

llvm error: linking error to libLTO.so

During compilation of llvm I get following error:
llvm[2]: ======= Finished Linking Debug+Asserts Executable llvm-config
llvm[2]: Installing Debug+Asserts /usr/local/bin/llvm-config
make[2]: Leaving directory `/usr/bin/tools/llvm-config'
make[2]: Entering directory `/usr/bin/tools/lto'
llvm[2]: Compiling LTODisassembler.cpp for Debug+Asserts build (PIC)
llvm[2]: Compiling lto.cpp for Debug+Asserts build (PIC)
llvm[2]: Linking Debug+Asserts Shared Library libLTO.so
collect2: ld terminated with signal 9 [Killed]
make[2]: *** [/usr/bin/Debug+Asserts/lib/libLTO.so] Error 1
make[2]: Leaving directory `/usr/bin/tools/lto'
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/bin/tools'
make: *** [install] Error 1
I do configure llvm by giving path of gcc & g++ compilers.
I don't get any error during configuration; but during build same error persist with clang also. I am using Ubntu-12.10 32 bit.
OK, so to solve this problem, I referred to llvm.org and during configuration added few options as follows:
sudo ./configure CC="/usr/bin/gcc" CXX="/usr/bin/g++" --enable-optimization --enable-jit --enable-debug-runtime --enable-targets=all
And I ran a build as SuperUser.
I faced the same error using Ubuntu 13.04 (arch: x86_64). The following error
collect2: ld terminated with signal 9 [Killed]
was an issue with memory usage. I was indeed using a Koding.com cloud VM with 1GB RAM.
I tried the compilation on my laptop as a normal user and the compilation finished without any issues. I used:
$ ./configure
$ make -j4