Home > OS >  Cross-compilation NTP under Linux source and are eventually used to compile the NTPD as Shared objec
Cross-compilation NTP under Linux source and are eventually used to compile the NTPD as Shared objec

Time:10-05

As title, cross-compilation NTP under Linux source code, eventually used to compile the NTPD as Shared object, why shouldn't be the executable object files,
NTPD: ELF 32 - bit LSB Shared object, ARM, EABI4 version 1 (SYSV), dynamically linked (USES Shared libs), for the GNU/Linux 2.6.14, not stripped

CodePudding user response:

Should be a compiler options did not open

CodePudding user response:

This compilation, has recently been doing GCC compiler 4.2.0, cross-compilation old version of the source code is compiled into the executable (NTP), a new version of the NTP after the source code to compile a Shared object, on the development board after running period of mistakes, the compiler did not change, only have upgrade source, later also found a lot of relevant explanations, there are said to be generated Shared object because a pie and PIC compiler options, now the problem is confusion, don't know what is the question of the GCC compiler options, or am I the new NTP source problem, compare with,

CodePudding user response:

With you to say so it ought to be you there was a problem in the high version of the source code, Ken? Is the high version of the source makefile. If there is a change in, you can look at

CodePudding user response:

Should not be a Makefile in question, I compare the two versions of old and new, are all small changes, and I use the old version Makefile. In compiling the new source, problems still exist, but I found that there is a difference, configure, new old information is not consistent, the new added pie option inside, and the old version does not have, I also checked the Internet pie options can make the executable program compiled into a Shared format, the question now is, how can we remove the pie options? Below is configuration information interception,
configure: running/bin/bash ./configure --disable-option-checking '--prefix=/home/lhq/ntpcmd' 'LEP_LDFLAGS=-pie -Wl,-z,relro -Wl,-z,now' 'LEP_CPPFLAGS=-D_FORTIFY_SOURCE=2' 'LEP_CFLAGS=-fPIE -fPIC -fstack-protector-all -O1' '--enable-function-sections' '--enable-silent-rules' '--disable-libevent-install' '--disable-libevent-regress' '--disable-shared' '--disable-openssl' 'CC=/opt/arm-2007q1/bin/arm-none-linux-gnueabi-gcc' '--host=arm-none-linux-gnueabi' '--with-yielding-select=yes' 'host_alias=arm-none-linux-gnueabi' --cache-file=/dev/null --srcdir=.

CodePudding user response:

Look at the link is opened - r, - I, - relocatable options

CodePudding user response:

Tried to use - pie does generate Shared object, should not affect normal use to...

CodePudding user response:

Modify the configure. Ac check option this file is compiled
  • Related