Artfunkel
Artfunkel

Reputation: 1852

Compiling libcurl x86 on Linux x64

I've cross-compiled the bulk of my 32-bit code on my x64 Ubuntu install, but I can't work out how to do the same trick with libcurl.

I've tried many permutations of --host and/or --build i486, x86, etc. but none have helped. I've also tried editing the makefiles to include gcc's -m32 flag manually, but it never shows up when I run them.

What should I be doing?

Upvotes: 0

Views: 5957

Answers (2)

Xan
Xan

Reputation: 776

After you download and extract the libcurl source package, as a root user, run this command for setting up the build environment.

configure --host=i686-pc-linux-gnu CFLAGS=-m32 CC=/usr/bin/gcc

followed by

make

you can find the libs under ./lib/.libs/libcurl.so from where you ran the make command. if you dont find /usr/bin/gcc, you will have to install gcc for 32-bit cross compilation env in a 64-bit machine.

Upvotes: 4

jcopenha
jcopenha

Reputation: 3975

It would help if you gave us an error message. I've had issues on Ubuntu x64 systems compiling 32-bit code with 'ld' errors.. I solved it by adding LDEMULATION=elf_i386 to my environment.

Upvotes: 0

Related Questions