ld: cannot open output file conftest.exe: Permission denied - msys2

Using MSYS2 (version x86_64-20160205) on Windows 7 64bits, I'm trying to compile corkscrew.
Here is the output:
$ ./configure
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) no
checking for working aclocal... found
checking for working autoconf... missing
checking for working automake... found
checking for working autoheader... missing
checking for working makeinfo... missing
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking how to run the C preprocessor... (cached) gcc -E
checking for function prototypes... yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
And the content of config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:556: checking for a BSD compatible install
configure:609: checking whether build environment is sane
configure:666: checking whether make sets ${MAKE}
configure:712: checking for working aclocal
configure:725: checking for working autoconf
configure:738: checking for working automake
configure:751: checking for working autoheader
configure:764: checking for working makeinfo
configure:783: checking for gcc
configure:896: checking whether the C compiler (gcc ) works
configure:912: gcc -o conftest conftest.c 1>&5
configure:909:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(){return(0);}
^
configure:938: checking whether the C compiler (gcc ) is a cross-compiler
configure:943: checking whether we are using GNU C
configure:971: checking whether gcc accepts -g
configure:1006: checking for gcc option to accept ANSI C
configure:1083: checking how to run the C preprocessor
configure:1165: checking for function prototypes
configure:1327: checking for gcc
configure:1440: checking whether the C compiler (gcc -g -O2 ) works
configure:1456: gcc -o conftest -g -O2 conftest.c 1>&5
configure:1453:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(){return(0);}
^
/usr/lib/gcc/x86_64-pc-msys/5.3.0/../../../../x86_64-pc-msys/bin/ld: cannot open output file conftest.exe: Permission denied
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 1451 "configure"
#include "confdefs.h"
main(){return(0);}
I've tested this answer without any success. Or to be more precise, it goes to the next step (which is failing at detecting my system, which is more a corkscrew's config issue I think) randomly...
This is not a rights problem as I have all the rights on that folder and I use my user to execute ./configure.
Any idea?

It looks like ld is having trouble creating an executable file due to permission problems. Try building the program in a folder that you are sure that you own (like C:\Users\yourusername) or try adjusting the permissions for the folder you are building in.

Related

Tryiing to build bitcoind on mac using port

I am following the instructions for the MacOS X port version to build bitcoind, but make finally cannot find a makefile to continiue the build:
ginger:bitcoin sven.haiges$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I src/m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /opt/local/bin/autoconf --force
autoreconf: running: /opt/local/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
configure.ac:730: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
autoreconf: Leaving directory `.'
ginger:bitcoin sven.haiges$ ls
COPYING Makefile.in autogen.sh configure doc share
INSTALL README.md autom4te.cache configure.ac pkg.m4 src
Makefile.am aclocal.m4 config.log contrib qa
ginger:bitcoin sven.haiges$ ./configure
checking build system type... x86_64-apple-darwin12.5.0
checking host system type... x86_64-apple-darwin12.5.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... src/build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking how to run the C++ preprocessor... g++ -E
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... yes
checking whether gcc accepts -g... yes
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU Objective C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for ar... /usr/bin/ar
checking for ranlib... /usr/bin/ranlib
checking for strip... /usr/bin/strip
checking for gcov... /usr/bin/gcov
checking for lcov... no
checking for java... /usr/bin/java
checking for genhtml... no
checking for git... /usr/bin/git
checking for moc-qt4... no
checking for moc4... no
checking for moc... no
configure: WARNING: MOC not found; bitcoin-qt frontend will not be built
checking for ccache... no
checking for lupdate-qt4... no
checking for lupdate4... no
checking for lupdate... no
checking for xgettext... /opt/local/bin/xgettext
checking for hexdump... /usr/bin/hexdump
checking for pkg-config... no
checking for port... port
checking for brew... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for PTHREAD_PRIO_INHERIT... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether the linker accepts -Wl,--large-address-aware... no
checking whether C++ compiler accepts -Wstack-protector... yes
checking whether C++ compiler accepts -fPIE... yes
checking whether C++ preprocessor accepts -D_FORTIFY_SOURCE=2... yes
checking whether the linker accepts -Wl,--dynamicbase... no
checking whether the linker accepts -Wl,--nxcompat... no
checking whether the linker accepts -Wl,-z,relro... no
checking whether the linker accepts -Wl,-z,now... no
checking whether C++ compiler accepts -fno-stack-protector... yes
checking whether C++ compiler accepts -fstack-protector-all... yes
checking whether the linker accepts -pie... yes
checking whether the linker accepts -Wl,-dead_strip... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for MSG_NOSIGNAL... no
checking for Berkeley DB C++ headers... /opt/local/include/db48/
checking for main in -ldb_cxx-4.8... yes
checking for main in -lminiupnpc... yes
checking for boostlib >= 1.20.0... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system-mt... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem-mt... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options-mt... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread-mt... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
configure: error: pkg-config not found.
ginger:bitcoin sven.haiges$ make
make: *** No targets specified and no makefile found. Stop.
ginger:bitcoin sven.haiges$ ls
COPYING Makefile.in autogen.sh configure doc share
INSTALL README.md autom4te.cache configure.ac pkg.m4 src
Makefile.am aclocal.m4 config.log contrib qa
ginger:bitcoin sven.haiges$ ci Makefile.in
Makefile.in,v > :q^[^X^X^C
RCS: Interrupt
RCS: Cleaning up.
ginger:bitcoin sven.haiges$
ginger:bitcoin sven.haiges$
ginger:bitcoin sven.haiges$ vi Makefile.in
ginger:bitcoin sven.haiges$ make Makefile.in
make: Nothing to be done for `Makefile.in'.
ginger:bitcoin sven.haiges$ make Makefile.am
make: Nothing to be done for `Makefile.am'.
ginger:bitcoin sven.haiges$
Any ideas?
You have to install pkg-config before running ./configure
sudo port install pkgconfig

Using Heroku Vulcan to build lib with dependency

Mission: Make a build of ffmpegthumbnailer that can be vendored with a Rails app and deployed to Heroku's Cedar stack.
Process so far:
[success] Build ffmpeg with Vulcan (using this guide) and upload to S3
[failed] Build ffmpegthumbnailer with ffmpeg as dependency.
Using command:
$ vulcan build -v -s ffmpegthumbnailer-2.0.8 -d http://s3.amazonaws.com/remoting-io-cdn/heroku-building-lib/ffmpeg
I get the following (see error at the bottom):
Packaging local directory... done
Uploading source package... done
Building with: ./configure --prefix /app/vendor/ffmpegthumbnailer-2.0 && make install
downloading http://s3.amazonaws.com/remoting-io-cdn/heroku-building-lib/ffmpeg
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether make supports nested variables... yes
checking for ANSI C header files... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking whether /usr/bin/ld -m elf_x86_64 accepts --as-needed... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFMPEG... no
configure: error: Package requirements (libavutil libavformat libavcodec >= 52.26.0 libswscale) were not met:
No package 'libavutil' found
No package 'libavformat' found
No package 'libavcodec' found
No package 'libswscale' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FFMPEG_CFLAGS
and FFMPEG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
bin/vulcan-make:69:in `chdir': No such file or directory - /app/vendor/ffmpegthumbnailer-2.0 (Errno::ENOENT)
from bin/vulcan-make:69:in `block (2 levels) in <main>'
from bin/vulcan-make:18:in `chdir'
from bin/vulcan-make:18:in `block in <main>'
from /usr/local/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from bin/vulcan-make:17:in `<main>'
>> Downloading build artifacts to: /tmp/ffmpegthumbnailer-2.0.tgz
(available at http://remoting-io-lib-builder.herokuapp.com/output/e25f3591-ce65-433d-a45a-15bd7ea36109)
What does that error message mean? And what should I do differently to compile it correctly?
You have a few problems
You need to build it's dependencies first (libavutil, libavformat, libavcodec, libswscale)
The thing that you downloaded is not actually the build (the build never happened it failed at configure) It is just the artifacts from the progress that was made.
I have had much more success with hammer (https://github.com/hone/hammer) then vulcan in terms of reusability.
To solve this you are going to need to go through this same process for each of the dependancies then in your build script pull them down from s3 extract them and make sure that they are in your path or lib directory.
I have also found that heroku run bash is invaluable when hacking on these things because it allows you to tinker with your environment more.
ffmpeg and ffmpegthumbnailer can be build with Vulcan following the steps explained here
A sample app with vendored ffmpeg and ffmpegthumbnailer is available here: https://github.com/JonasNielsen/ffmpegthumbnailer Check out the Heroku configuration instructions in the readme.

configure script not enabling make to generate shared library

This is in regards to compiling libjpeg v6b if that is relevant.
I run ./configure --prefix=/c/tmp/jpeg-6b-build --enable-shared --enable-static like the install doc says but libtool isn't having it.
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
I think I need this shared library to be able to compile some functions. libjpeg itself compiles fine and the .exe's it generates work but I need to use the source for something else. v6b doesn't generate a .DLL for some reason while v9 does.
Full output for ./configure command:
ild
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a BSD compatible install... /bin/install -c
checking for ranlib... ranlib
checking host system type... i386-pc-mingw32
checking for ranlib... ranlib
checking for gcc... gcc
checking whether we are using GNU C... yes
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no
checking if gcc static flag -static works... -static
checking whether ln -s works... no
checking for ld used by GCC... ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../
../mingw32/bin/ld.exe
checking if the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../ming
w32/bin/ld.exe) is GNU ld... yes
checking whether the linker (./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../..
/mingw32/bin/ld.exe) supports shared libraries... yes
checking for BSD-compatible nm... /mingw/bin/nm
checking command to parse /mingw/bin/nm output... no
checking how to hardcode library paths into programs... immediate
checking for ./c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.
exe option to reload object files... -r
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
Related question: Need help compiling jpegtran.c code from libjpeg
I encountered the same problem, and I believe it is because jpeg-6b is built with a very old version of autotools (the jpeg-6b version dates back 1998 if the sourceforge page is correct).
In particular, the problem is the way it checks if gcc supports the -fPIC flag:
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... no
And this is how they perform the check from config.log:
ltconfig:547: checking if gcc PIC flag -fPIC works
ltconfig:548: gcc -c -fPIC -DPIC -I/local/include conftest.c 1>&5
conftest.c:1:0: warning: -fPIC ignored for target (all code is position independent)
^
Notice how gcc returns a warning, it probably returns exit code 1 which makes the check fail. And position-independent code is necessary for shared libraries, so this makes it think it can't make them, and it later outputs:
checking whether to build shared libraries... no
Compare that with libjpeg9, which I assume uses a more up-to-date version of autotools:
checking for gcc -std=gnu99 option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works... yes
And from config.log:
configure:10108: checking for gcc -std=gnu99 option to produce PIC
configure:10115: result: -DDLL_EXPORT -DPIC
configure:10123: checking if gcc -std=gnu99 PIC flag -DDLL_EXPORT -DPIC works
configure:10141: gcc -std=gnu99 -c -g -O2 -I/local/include -DDLL_EXPORT -DPIC -DPIC conftest.c >&5
configure:10145: $? = 0
configure:10158: result: yes
I eventually compiled libjpeg9 instead, but I think libjpeg6 might also be compilable if you can recreate the ./configure script using a newer version of autotools.
You should probably try to run
./configure --help
and see all available configure flags, maybe you misspelled some or you need --enable-dynamic or something different.
For configure output you could also refer to config.log, that is in the project's (in your case -- libjpeg's) directory, just next to the configure file.

Cross-compile Apache apr-util library for ARM - Linux platform

first post~
I'm trying to port ActiveMQ-cpp client to an ARM platform (Beaglebone/BeagleBoard) - since I'm doing my development on my PC, I'll need to cross-compile the ActiveMQ-cpp library in order for it to run on the ARM systems.
I follow through the steps in their building instruction, except I compile the APR and the APR-util library using the following:
For APR:
./configure --prefix=/usr/arm-linux-gnueabi/apr --host=arm-linux-gnueabi CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++"
I run make install and things are fine.
For APR-util:
./configure --prefix=/usr/arm-linux-gnueabi/apr-util --host=arm-linux-gnueabi -with-apr=/usr/arm-linux-gnueabi/apr CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++"
I run make install and got this:
/home/peter/apache/Apache_apr/apr-util-1.5.1/xml/expat/.libs/libexpat.so: could not read symbols: File in wrong format
After some search, I 'think' the issue is with libexpat being the in the wrong format (compiled for i386?)
My question is: How to I properly compile ActiveMQ-cpp library for a ARM-platform? Is there some way I can fix the libexpat.so? or skip Apr-util? or some option in the ./configure for Apr-util?
Follow-up:
Here is the log file from running configure:
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking target system type... arm-unknown-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.5.1
checking for chosen layout... apr-util
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabi-gcc accepts -g... yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for arm-unknown-linux-gnueabi
checking for APR... yes
setting CPP to "gcc -E"
adding "-pthread" to CFLAGS
setting CPPFLAGS to " -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE"
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... no
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking sybdb.h usability... no
checking sybdb.h presence... no
checking for sybdb.h... no
checking freetds/sybdb.h usability... no
checking freetds/sybdb.h presence... no
checking for freetds/sybdb.h... no
checking for odbc_config... no
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking odbc/sql.h usability... no
checking odbc/sql.h presence... no
checking for odbc/sql.h... no
checking Expat 1.95.x... no
checking old Debian-packaged expat... no
checking old FreeBSD-packaged expat... no
checking Expat 1.0/1.1... no
setting LDFLAGS to "-L/usr/local/lib"
adding "-I/usr/local/include" to CPPFLAGS
checking Expat 1.95.x in /usr/local... no
nulling LDFLAGS
removed "-I/usr/local/include" from CPPFLAGS
configuring package in xml/expat now
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking target system type... arm-unknown-linux-gnueabi
checking how to print strings... printf
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabi-gcc accepts -g... yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabi-gcc... /usr/arm-linux-gnueabi/bin/ld
checking if the linker (/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/arm-linux-gnueabi-nm -B
checking the name lister (/usr/bin/arm-linux-gnueabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to arm-unknown-linux-gnueabi format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/arm-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-linux-gnueabi-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabi-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-gnueabi-ar... arm-linux-gnueabi-ar
checking for archiver #FILE support... #
checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-strip
checking for arm-linux-gnueabi-ranlib... arm-linux-gnueabi-ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/arm-linux-gnueabi-nm -B output from arm-linux-gnueabi-gcc object... ok
checking for sysroot... no
checking for arm-linux-gnueabi-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking how to run the C preprocessor... arm-linux-gnueabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabi-gcc static flag -static works... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabi-gcc linker (/usr/arm-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for arm-linux-gnueabi-gcc... (cached) arm-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for memmove... yes
checking for bcopy... yes
checking check.h usability... no
checking check.h presence... no
checking for check.h... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating expat_config.h
config.status: expat_config.h is unchanged
config.status: executing libtool commands
xml/expat configured properly
setting APRUTIL_INCLUDES to "-I/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/lib"
setting LDFLAGS to "-L/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/lib"
setting APRUTIL_EXPORT_LIBS to "/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/libexpat.la"
setting APRUTIL_LIBS to "/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/libexpat.la"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
adding "/usr/arm-linux-gnueabi/apr/lib/libapr-1.la" to APRUTIL_LIBS
adding "-luuid" to APRUTIL_LIBS
adding "-lrt" to APRUTIL_LIBS
adding "-lcrypt" to APRUTIL_LIBS
adding "-lpthread" to APRUTIL_LIBS
adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands
From what I can see, xml/expat configured properly. I thought - maybe I need to compile expat library in gcc-arm-linux? I went on, do that, and run the configure again:
./configure --prefix=/usr/arm-linux-gnueabi/apr-util --host=arm-linux-gnueabi -with-apr=/usr/arm-linux-gnueabi/apr -with-expat=/usr/arm-linux-gnueabi/expat CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++"
I got similar result in the log, except I now have Expat 1.95.x:
checking for odbc/sql.h... no
setting LDFLAGS to "-L/usr/arm-linux-gnueabi/expat/lib"
adding "-I/usr/arm-linux-gnueabi/expat/include" to CPPFLAGS
setting APRUTIL_INCLUDES to "-I/usr/arm-linux-gnueabi/expat/include"
setting APRUTIL_LDFLAGS to "-L/usr/arm-linux-gnueabi/expat/lib"
checking Expat 1.95.x... yes
setting APRUTIL_EXPORT_LIBS to "-lexpat"
setting APRUTIL_LIBS to "-lexpat"
run make, same error occurred.
I did a search on errors related to libexpat.so. I notice those who wants to cross-compile usually see this "libexpat.so" error: with centos 5.2 64bits, with or another case with Xeon 64bit.
Below is the command that actually cause the error:
make[1]: Entering directory `/home/jacky/apache/Apache_apr/apr-util-1.5.1'
/bin/bash /usr/arm-linux-gnueabi/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -DHAVE_CONFIG_H -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/home/jacky/apache/Apache_apr/apr-util-1.5.1/include -I/home/jacky/apache/Apache_apr/apr-util-1.5.1/include/private -I/usr/arm-linux-gnueabi/apr/include/apr-1 -I/usr/arm-linux-gnueabi/expat/include -version-info 5:1:5 -o libaprutil-1.la -rpath /usr/arm-linux-gnueabi/apr-util/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo -luuid -lrt -lcrypt -lpthread -ldl -L/usr/arm-linux-gnueabi/expat/lib -lexpat /usr/arm-linux-gnueabi/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl
/usr/arm-linux-gnueabi/expat/lib/libexpat.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [libaprutil-1.la] Error 1
make[1]: Leaving directory `/home/jacky/apache/Apache_apr/apr-util-1.5.1'
make: *** [all-recursive] Error 1
Many thanks to your help!
It seems you have some library build earlier in different format. Due to which you are getting the error:
File in wrong format
collect2: ld returned 1 exit status
Run file command over /usr/arm-linux-gnueabi/expat/lib/libexpat.so
If it shows for some different format then you need to rebuild it.
But its weird as I think its an pre-build arm library and it should be in correct format.

Compiling GDC on Windows -- where to get GMP and MPFR dependencies?

I'm trying to compile GDC (v2) on Windows 7, using MinGW's MSYS.
When I get to this step:
$ ../configure --enable-languages=d --disable-shared --disable-bootstrap
I get:
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
This made me look back at the instructions, which noted that it needs these libraries:
libgmp3-dev
libmpfr-dev
libmpc-dev
So now the question is, where do I find these headers and/or libraries? I've searched all over for libgmp3-dev, but I can't find anything for Windows. (I'm still in the learning process for *nix, so I'm not too familiar with anything.)
Thanks!
Update:
So I tried to make MPFR (I don't even know if it was the right version), and I got this error:
$ make install
Making install in tests
[...]
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
/bin/sh ./libtool --mode=install /bin/install -c libmpfr.la '/usr/local/lib'
libtool: install: /bin/install -c .libs/libmpfr.lai /usr/local/lib/libmpfr.la
libtool: install: /bin/install -c .libs/libmpfr.a /usr/local/lib/libmpfr.a
libtool: install: chmod 644 /usr/local/lib/libmpfr.a
libtool: install: ranlib /usr/local/lib/libmpfr.a
/bin/sh: /home/Home: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 127
make[2]: Leaving directory `/home/Home User/mpfr-2.4.2'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/Home User/mpfr-2.4.2'
make: *** [install-recursive] Error 1
Any ideas?
From https://bitbucket.org/goshawk/gdc/wiki/MinGWCompile :
ftp://ftp.gmplib.org/pub/gmp-5.0.1/gmp-5.0.1.tar.bz2
http://www.mpfr.org/mpfr-current/mpfr-3.0.0.tar.bz2
http://gmplib.org/
http://www.mpfr.org/
Just download the source tarballs. As for building these, I don't remember the details (the instructions should be clear on this) but I know you can put these GMP and MPFR in the source tree with GCC and the GCC build process will automatically take care of building these. This may be easier than building/installing/setting environment variables for them as a discrete step.
I always use this for building gdc on Windows: http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php
The error message you posted has the links to find the libraries. You might need to download their source code and compile them, but they are both easy to build.