Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to cross compile StrongSwan package on Ubuntu for Synology NAS using official Synology toolchain.

hostname = ubuntu
uname -m = i686
uname -r = 3.8.0-32-generic
uname -s = Linux

- model DS213+
- CPU: Freescale QorIQ P1022
- Arch: PowerPC
- Endianness: Big Endian
- Linux 2.6.32
- uname -a:
Linux LupoDiskStation #3776 SMP Sat Aug 17 02:11:24 CST 2013 ppc
GNU/Linux synology_qoriq_213+

When I run ./configure, I get error:

configure: error: GNU Multi Precision library gmp not found

Configure command:

env CC=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-gcc \
LD=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ld \ 
RANLIB=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ranlib \ 
CFLAGS="-I/usr/local/powerpc-none-linux-gnuspe/include -mcpu=8548 -mhard-float -mfloat-gprs=double" \ 
LDFLAGS="-L/usr/local/powerpc-none-linux-gnuspe/lib" \ 
./configure \ 
--host=powerpc-unknown-linux \ 
--target=powerpc-unknown-linux \ 
--build=i686-pc-linux \ 

If I run ./configure without extra parameters (with ubuntu gcc), I get no errors. I can also successfully compile helloworld.c with synology toolchain.

I've following GMP packages installed:

dpkg --get-selections | grep gmp
gmpc                        install
gmpc-data                   install
gmpc-dev                    install
libgmp-dev                  install
libgmp10                    install
libgmp3-dev                 install
libgmp3c2                   install
libgmpada2                  install
libgmpxx4ldbl                   install

Header file is under /usr/include/gmp.h.

Any idea how to include that gmp.h ?

share|improve this question

Ok so I read into the configure file try.

./configure \ 
--host=powerpc-unknown-linux \ 
--target=powerpc-unknown-linux \ 
--build=i686-pc-linux \ 
--prefix=/usr/local \
share|improve this answer
I've added --libdir="/usr/include" to the end of my configure command (including other flags: CC=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-gcc, ...) but it doesn't help. Maybe it would work if I replace original GCC commands with links to "powerpc-none-linux-gnuspe-gcc" or something ? – Lukapple Nov 20 '13 at 17:57
up vote 0 down vote accepted

It's working now. I had to download gmp, cross compile it and copy files to /usr/local/powerpc-none-linux-gnuspe/include dir.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.