hyperrealm / libconfig

C/C++ library for processing configuration files
https://hyperrealm.github.io/libconfig/
GNU Lesser General Public License v2.1
1.1k stars 359 forks source link

cross compiling for qnx #144

Open cy-goh opened 5 years ago

cy-goh commented 5 years ago

Hi I'm trying to cross compile for qnx7 aarch64le from my ubuntu 18.04 environment.

I tried the following configurations. However, during compilation, I seem to be lacking this file .deps/libconfig___la-libconfigcpp.TPlo. I have no experience with libtool and cross compilation so wish someone can help me here.

QNX_BINS="${QNX_HOST}/usr/bin"

./configure CC="${QNX_BINS}/qcc" CXX="${QNX_BINS}/QCC" CFLAGS="-fpic -Vgcc_ntoaarch64le" CXXFLAGS="-fpic -Vgcc_ntoaarch64le -Y_cxx" OS=qnx7 --target=aarch64-qnx-qnx --host=x86_64-linux-gnu RANLIB="${QNX_BINS}/aarch64-unknown-nto-qnx7.0.0-ranlib" AR="${QNX_BINS}/aarch64-unknown-nto-qnx7.0.0-ar" LD="${QNX_BINS}/aarch64-unknown-nto-qnx7.0.0-ld" LDCXX="${QNX_BINS}/aarch64-unknown-nto-qnx7.0.0-ld"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... aarch64-qnx-nto-qnx
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-linux-gnu-strip... x86_64-linux-gnu-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
configure: libconfig - made with pride in Colorado
checking for style of include used by make... GNU
checking for x86_64-linux-gnu-gcc... /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc
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 /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc accepts -g... yes
checking for /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc option to accept ISO C89... none needed
checking whether /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc understands -c and -o together... yes
checking dependency style of /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc... gcc
checking how to run the C preprocessor... /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc -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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc... /home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld
checking if the linker (/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/x86_64-linux-gnu-nm -B
checking the name lister (/usr/bin/x86_64-linux-gnu-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-pc-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 /home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld option to reload object files... -r
checking for x86_64-linux-gnu-objdump... x86_64-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-linux-gnu-ar... /home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ar
checking for archiver @FILE support... @
checking for x86_64-linux-gnu-strip... (cached) x86_64-linux-gnu-strip
checking for x86_64-linux-gnu-ranlib... /home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ranlib
checking command to parse /usr/bin/x86_64-linux-gnu-nm -B output from /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc object... ok
checking for sysroot... no
checking for x86_64-linux-gnu-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 for dlfcn.h... yes
checking for objdir... .libs
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc supports -fno-rtti -fno-exceptions... no
checking for /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc option to produce PIC... -fPIC -DPIC
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc PIC flag -fPIC -DPIC works... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc static flag -static works... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc supports -c -o file.o... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc supports -c -o file.o... (cached) yes
checking whether the /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc linker (/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld -m elf_x86_64) supports shared libraries... no
checking dynamic linker characteristics... cc: no files to process
GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for x86_64-linux-gnu-gcc... (cached) /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc accepts -g... (cached) yes
checking for /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc option to accept ISO C89... (cached) none needed
checking whether /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc understands -c and -o together... (cached) yes
checking dependency style of /home/cy/qnx700/host/linux/x86_64/usr/bin/qcc... (cached) gcc
checking whether we are using the GNU C++ compiler... yes
checking whether /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC accepts -g... yes
checking dependency style of /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC... gcc
checking how to run the C++ preprocessor... /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC -E
checking for ld used by /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC... /home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld
checking if the linker (/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld) is GNU ld... yes
cc: no files to process
checking whether the /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC linker (/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld) supports shared libraries... yes
checking for /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC option to produce PIC... -fPIC -DPIC
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC PIC flag -fPIC -DPIC works... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC static flag -static works... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC supports -c -o file.o... yes
checking if /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC supports -c -o file.o... (cached) yes
checking whether the /home/cy/qnx700/host/linux/x86_64/usr/bin/QCC linker (/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for flex... no
checking for lex... no
*******************************************************************
You do not seem to have flex. While flex is not required to build
libconfig, you may need it to regenerate the lexer if you change
the scanner.l file.
*******************************************************************
checking for bison... no
checking for byacc... no
*******************************************************************
You do not seem to have bison. While bison is not required to build
libconfig, you may need it to regenerate the parser if you change
the grammar.y file.
*******************************************************************
checking for compiler switch to enable full C/C++ warnings... (cannot determine)
checking for ANSI C header files... (cached) yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking xlocale.h usability... no
checking xlocale.h presence... no
checking for xlocale.h... no
checking for an ANSI C-conforming const... yes
checking for newlocale... no
checking for uselocale... no
checking for freelocale... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating lib/libconfig.pc
config.status: creating lib/libconfig++.pc
config.status: creating lib/libconfigConfig.cmake
config.status: creating lib/libconfig++Config.cmake
config.status: creating doc/Makefile
config.status: creating examples/Makefile
config.status: creating examples/c/Makefile
config.status: creating examples/c++/Makefile
config.status: creating tinytest/Makefile
config.status: creating tests/Makefile
config.status: creating libconfig.spec
config.status: creating ac_config.h
config.status: ac_config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

error when I run make,

make  all-recursive
make[1]: Entering directory '/home/cy/Downloads/libconfig-1.7 (3).2'
Making all in lib
make[2]: Entering directory '/home/cy/Downloads/libconfig-1.7 (3).2/lib'
make  all-am
make[3]: Entering directory '/home/cy/Downloads/libconfig-1.7 (3).2/lib'
  CC       libconfig_la-grammar.lo
  CC       libconfig_la-libconfig.lo
libconfig.c: In function '__config_locale_override':
libconfig.c:99:2: warning: #warning "No way to modify calling thread's locale!" [-Wcpp]
 #warning "No way to modify calling thread's locale!"
  ^
libconfig.c: In function '__config_locale_restore':
libconfig.c:120:2: warning: #warning "No way to modify calling thread's locale!" [-Wcpp]
 #warning "No way to modify calling thread's locale!"
  ^
  CC       libconfig_la-scanctx.lo
  CC       libconfig_la-scanner.lo
  CC       libconfig_la-strbuf.lo
  CC       libconfig_la-strvec.lo
  CC       libconfig_la-util.lo
  CC       libconfig_la-wincompat.lo
  CCLD     libconfig.la
  CC       libconfig___la-grammar.lo
  CC       libconfig___la-libconfig.lo
libconfig.c: In function '__config_locale_override':
libconfig.c:99:2: warning: #warning "No way to modify calling thread's locale!" [-Wcpp]
 #warning "No way to modify calling thread's locale!"
  ^
libconfig.c: In function '__config_locale_restore':
libconfig.c:120:2: warning: #warning "No way to modify calling thread's locale!" [-Wcpp]
 #warning "No way to modify calling thread's locale!"
  ^
  CC       libconfig___la-scanctx.lo
  CC       libconfig___la-scanner.lo
  CC       libconfig___la-strbuf.lo
  CC       libconfig___la-strvec.lo
  CC       libconfig___la-util.lo
  CC       libconfig___la-wincompat.lo
  CXX      libconfig___la-libconfigcpp.lo
../aux-build/depcomp: line 227: .deps/libconfig___la-libconfigcpp.TPlo: No such file or directory
../aux-build/depcomp: line 241: .deps/libconfig___la-libconfigcpp.TPlo: No such file or directory
  CXXLD    libconfig++.la
/home/cy/qnx700/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.0.0-ar: libconfig___la-libconfigcpp.o: No such file or directory
Makefile:540: recipe for target 'libconfig++.la' failed
make[3]: *** [libconfig++.la] Error 1
make[3]: Leaving directory '/home/cy/Downloads/libconfig-1.7 (3).2/lib'
Makefile:459: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/cy/Downloads/libconfig-1.7 (3).2/lib'
Makefile:444: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/cy/Downloads/libconfig-1.7 (3).2'
Makefile:374: recipe for target 'all' failed
make: *** [all] Error 2
hyperrealm commented 4 years ago

I can't really offer any help here, since I'm not familiar with and don't have access to QNX. You might try installing the latest auto tools (autoconf, automake, libtool) on your QNX system and re-generate the configure script on the system (by running aclocal, acheader, autoconf, etc.), and see if that resolves it.

zangetsudo commented 3 years ago

hi, cy did fix this issue? cus im facing the same issue.

cy-goh commented 3 years ago

@zangetsudo nope, I didn't get it to work. In the end I used another header only library.

ShaiNata commented 6 months ago

I have succeeded in building libconfig for qnx7 aarch64le in windows by using msys2. The tricky part was adding -Vgcc_ntoaarch64le to CC and CXX.

Please use the following example:

export QNX_HOST=/c/QNX/qnx710/host/win64/x86_64 #Please change the qnx path export QNX_TARGET=/c/QNX/qnx710/target/qnx7 #Please change the qnx path export SYSROOT=$QNX_TARGET/aarch64le/usr/ export ABI=aarch64-unknown-nto-qnx7.1.0

export AR=$QNX_HOST/usr/bin/$ABI-ar.exe export AS=$QNX_HOST/usr/bin/$ABI-as.exe export CC="$QNX_HOST/usr/bin/qcc.exe -Vgcc_ntoaarch64le" export CXX="$QNX_HOST/usr/bin/q++.exe -Vgcc_ntoaarch64le_gpp" export LD=$QNX_HOST/usr/bin/$ABI-ld.exe export NM=$QNX_HOST/usr/bin/$ABI-nm.exe export OBJDUMP=$QNX_HOST/usr/bin/$ABI-objdump.exe export RANLIB=$QNX_HOST/usr/bin/$ABI-ranlib.exe export STRIP=$QNX_HOST/usr/bin/$ABI-strip.exe export CFLAGS="-fPIC -D_QNX_SOURCE -O3" export CXXFLAGS="-stdlib=libstdc++ -fPIC -D_QNX_SOURCE -O3" export LDFLAGS="-pie"

mkdir -p out export OUTDIR=$PWD/out

autoreconf -if ./configure --prefix=$OUTDIR --host=$ABI --with-sysroot=$SYSROOT --enable-static=no --disable-cxx --disable-doc --disable-examples make clean make AM_DEFAULT_VERBOSITY=1 -j16 make install