Hi,
 
In a previous thread some sysroot issues were resolved, and I am able to build cross-compilers under gcc-linaro-snapshot-6.1-2016.07 for languages c, c++, and objc. My sysroot consisted of a loopback mounted dd copy of an Ubuntu 14.04 file system for aarch64. That particular file system runs on a quad core Cortex-A57, and is fully capable of compiling many different types of software (the file system is set up for development). The successful configuration was like this (configuration and compile was from an independent directory not in the source tree):
 
export SRC='/home/build/linaro/gcc-linaro-snapshot-6.1-2016.07'
export TRIPLET=aarch64-linux-gnu
export CLONE=/usr/local/sysroot/${TRIPLET}
export VENDOR_ID=gcc-linaro-6.1-2016.07
export LINUX_ARCH=arm64
 
${SRC}/configure --prefix=/usr/local/${TRIPLET}/${VENDOR_ID} --target=${TRIPLET} \
 --with-build-sysroot=${CLONE} \
 --enable-languages=c,c++,objc \
 --with-sysroot=/
 
Now I also need armhf (I must support both 32-bit and 64-bit), so I'm trying to figure out host and sysroot differences (I have been unable to get armhf to compile). The configuration is basically this variation of the above, plus some sysroot additional support:
 
export SRC='/home/build/linaro/gcc-linaro-snapshot-6.1-2016.07'
export TRIPLET=arm-linux-gnueabihf
export CLONE=/usr/local/sysroot/${TRIPLET}
export VENDOR_ID=gcc-linaro-6.1-2016.07
export LINUX_ARCH=armhf
 
${SRC}/configure --prefix=/usr/local/${TRIPLET}/${VENDOR_ID} --target=${TRIPLET} \
 --with-build-sysroot=${CLONE} \
 --enable-languages=c \
 --with-sysroot=/
 
Note that for testing purposes I tried to compile only languages of c, c++, and objc, each one at a time instead of together. Errors do not differ in any way for picking of any of those three languages. I also have a complete Ubuntu 14.04 file system for armhf which is fully equipped for building of each of those languages, and is perhaps in some ways more complete as a development environment than the previously successful aarch64 file system (the sysroot runs on a quad core Cortex-A15). I tried this purely armhf file system as the sysroot to rule out incorrect multiarch support, and the error did not change. I am guessing the issue is not the sysroot, but I wanted to verify this since there may be other requirements for armhf instead of aarch64.
 
I am at a loss though to explain why the host would be at issue since it appears all prerequisites were met and I had success with aarch64.
 
The details of the error seem to always occur in libcc1 build. I see this in the libcc1/config.log as the failure regardless of sysroot or supported language, and only while building for armhf:
 
configure:14569: checking for -rdynamic
configure:14579: result: yes
configure:14589: checking for library containing dlopen
configure:14620: gcc -o conftest -g -O2    conftest.c   >&5
/tmp/ccyhVkpp.o: In function `main':
/home/build/linaro/objdir/libcc1/conftest.c:38: undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
configure:14620: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libcc1"
| #define PACKAGE_TARNAME "libcc1"
| #define PACKAGE_VERSION "version-unused"
| #define PACKAGE_STRING "libcc1 version-unused"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_DECL_BASENAME 1
| /* end confdefs.h.  */
 
Are there different host requirements when building armhf versus aarch64 which might explain why dlopen is not found? FYI, both development and other support for dlopen exists already on the system, so the failure to find dlopen is not for lack of host support (related dlopen files all seem to be present on all tested sysroots as well, both as armhf and aarch64). Is this a sysroot issue, a host issue, or a configure issue?
 
Thanks!