-
Notifications
You must be signed in to change notification settings - Fork 123
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
Error when Cross-compiling library for ARMv7l #176
Comments
Are you using |
Currenty to find the libraries and compile the code I'm using the Cmake file This is my toolchain file: set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(cpu_flags "-march=armv7-a -mfloat-abi=softfp -mfpu=neon")
set(c_cxx_flags " -O2 -fexpensive-optimizations -frename-registers -fomit-frame-pointer -pthread")
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc ${cpu_flags})
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++ ${cpu_flags})
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-start-group -lpthread -lm -Wl,-end-group -Wl,--rpath=${target_dir}/lib -Wl,--dynamic-linker=${target_dir}/lib/ld-linux.so.3 -Wl,-O3 -Wl,--hash-style=gnu -Wl,--as-needed")
set(CMAKE_C_FLAGS ${c_cxx_flags})
set(CMAKE_CXX_FLAGS ${c_cxx_flags})
set(CMAKE_STRIP /usr/bin/arm-linux-gnueabi-strip)
set(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) I realized that my toolchain file was missing the specification But now I'm with a different error. It's a linking error too saying that: cannot find -lesmtp So now I'm going to cross compile libESMTP. But first, is this library realy necessary or just used for some feature? If so, is there an Cmake option where I can disable it? |
libESMTP is completely optional. If it's complaining about that, you likely have it installed on your build system - it is only used if it is found. The check happens here, perhaps this is not working correctly when cross-compiling. |
You need to build APR and APR-UTIL with your cross-compiler. To cross-compile APR you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure". |
On reflection, I am not sure I ever successfully build APR and APR-UTIL with a cross-compiler. What I found works is to use the conan package manager (and a Artifactory server from JFrog). This allows APR and APR-UTIL to be built on the native system and uploaded to the server for use in cross-compilation builds. The conan package manager can be used to install APR and APR-UTIL from the remote Artifactory server. |
So if I just comment this part I will be able to cross-compile successfully? If yes, I'll gonna try it and post here the results. |
That seems like a good thing to try.
I have no idea - I have found cross-compiling is hard to setup correctly. If the build scripts are not setup correctly it may not work. In theory, cross-compiling only checks things in the rootfs(e.g. include files, libraries). You may also need to worry about the |
Okay, I'm going to try this! But just one question, did the ./configure -C compiles something on my environment or just use some coreutils and other simple things? Because my target (which is also my host) environment it's pretty limited. It's a embedded armv7l running with BusyBox. |
The autotools As BusyBox does not support gcc, you will need to hack a cache file generated on some other armv7 machine (say a raspberrypi). Perhaps you should also look at this old PR |
how can i build log4cxx with linux arm cortex A9 |
If you have a specific issue compiling, please create a new issue. Every system is different, but the process of cross-compiling should be similar for all systems. |
I'm trying to cross compile the log4cxx lib for an armv7l arch.
Steps to reproduce:
Install the cross tolchain arm-linux-gnueabi
Start some env variables to hold directores
Expat dependency library
Configuring
Log4cxx instalation
Downloading and extracting source code
wget https://dlcdn.apache.org/logging/log4cxx/1.0.0/apache-log4cxx-1.0.0.tar.gz tar -xvf apache-log4cxx-1.0.0.tar.gz cd apache-log4cxx-1.0.0
Configuring
Error from configuration step
these are the log files of the errors:
CMakeError.log
CMakeOutput.log
The text was updated successfully, but these errors were encountered: