Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openswan compile #439

Open
JinShao1013 opened this issue Jul 27, 2020 · 3 comments
Open

openswan compile #439

JinShao1013 opened this issue Jul 27, 2020 · 3 comments

Comments

@JinShao1013
Copy link

hello
I want to put the openswan transplanted to embedded Linux, use the cross compiler, compile openswan - 2.6.51.5 source code, there is an error: no rule to make target 'XXXX/OBJ. Linux. Arm/lib/libopenswan libopenswan. A', men by Pluto. Stop.
Please help me.Thank you very much.
Crosscompile.sh is configured as follows:

#!/bin/sh

cross compile example

#export PREFIX=/volquad/arm-4.0.2
export PREFIX=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf
export DESTDIR=./out

export ARCH=arm
export CC=$PREFIX/bin/arm-linux-gnueabihf-gcc
export GCC=$PREFIX/bin/arm-linux-gnueabihf-gcc
export LD=$PREFIX/bin/arm-linux-gnueabihf-ld
export RANLIB=$PREFIX/arm-linux-gnueabihf-ranlib
export AR=$PREFIX/bin/arm-linux-gnueabihf-ar
export AS=$PREFIX/bin/arm-linux-gnueabihf-as
export STRIP=$PREFIX/bin/arm-linux-gnueabihf-strip
export LD_LIBRARY_PATH=$PREFIX/lib/gcc/arm-linux-gnueabihf-gcc/4.9.4/
export PATH=$PATH:$PREFIX/bin
export USERCOMPILE="-Wl,-elf2flt -DCOMPILER_HAS_NO_PRINTF_LIKE -O3 -g ${PORTDEFINE} -I$PREFIX/arm-elf/inc -L$PREFIX/lib/gcc-lib -DGCC_LINT -DLEAK_DETECTIVE -Dlinux -D__linux__"
export WERROR=' '

#now you can run:
make programs
#and binaries will appear in OBJ.linux.$ARCH/
#and run:
make install
#and the install will go into $DESTDIR/

note: the arm_tools I had failed to compile PRINTF_LIKE(x), so the code

for that was ifdef'ed with #ifndef COMPILER_HAS_NO_PRINTF_LIKE statements.

Add -DCOMPILER_HAS_NO_PRINTF_LIKE to enable the workaround.

EXECUTABLE FILE FORMAT

Some uClibc/busybox combinations use different executable files formats from

ELF. This is configured during Linux kernel build. One common format is

the BLFT file format. Do not manually convert ELF binaries to BLTF using

elf2flt as that will create invalid binaries. Instead add -Wl,-elf2flt to

your flags (CFLAGS / LDFLAGS / USERCOMPILE)

@mcr
Copy link
Contributor

mcr commented Jul 31, 2020

hi. I don't know what arm_tools you are using. I guess not gcc. I have built with with musl on Alpine Linux many times.
If you have no libopenswan.a, then it didn't compile correctly, or it doesn't do object directories correctly.
I recommend you put all the variables into Makefile.local, see Makefile.inc for what to set, your list of exports likely is not complete.

@mcr
Copy link
Contributor

mcr commented Jul 31, 2020

It's hard for me to imagine an embedded Linux that does not use gcc,clang,llvm and that actually works, and is actually Linux.

@mcr
Copy link
Contributor

mcr commented Jul 31, 2020

well, you are clearly using gcc from linaro, so it must be that your /usr/include is missing PRINTF_LIKE, so you should just fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants