Skip to content
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

Related to cross compilation #12

Closed
pioneerAlone opened this issue Aug 4, 2019 · 4 comments
Closed

Related to cross compilation #12

pioneerAlone opened this issue Aug 4, 2019 · 4 comments

Comments

@pioneerAlone
Copy link

Again disturbed,
Its configure does not support the use of CC variables to specify the cross toolchain;
The following error occurred with the --host=arm-linux CC=arm-linux-ggc command:

checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for arm-linux-gcc... arm-linux-gcc
checking whether the C compiler works... no
configure: error: in /home/book/merecat-master': configure: error: C compiler cannot create executables See config.log' for more details

@troglobit
Copy link
Owner

OK, I think I've fixed it now. For me it didn't fail that early, it failed on an mmap() check, which I've removed in c989dac.

For future errors, it really helps if you include the full config.log file so I can see your flags to configure etc. Here's is my build, I used a crosstool-NG toolchain I've built previously:

$ ./configure --host=arm-unknown-linux-gnueabi --without-ssl --without-zlib --without-config CC=arm-unknown-linux-gnueabi-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-unknown-linux-gnueabi-strip... arm-unknown-linux-gnueabi-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
checking for arm-unknown-linux-gnueabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for arm-unknown-linux-gnueabi-gcc... arm-unknown-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-unknown-linux-gnueabi-gcc accepts -g... yes
checking for arm-unknown-linux-gnueabi-gcc option to accept ISO C89... none needed
checking whether arm-unknown-linux-gnueabi-gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of arm-unknown-linux-gnueabi-gcc... gcc3
...
$ make -j5
make  all-recursive
make[1]: Entering directory '/home/jocke/Troglobit/merecat'
Making all in src
make[2]: Entering directory '/home/jocke/Troglobit/merecat/src'
  CC       merecat-base64.o
  CC       merecat-fdwatch.o
  CC       merecat-file.o
  CC       merecat-libhttpd.o
  CC       merecat-md5.o
  CC       merecat-merecat.o
  CC       merecat-mmc.o
  CC       merecat-pidfile.o
  CC       merecat-stack.o
  CC       merecat-srv.o
  CC       merecat-timers.o
  CC       merecat-tdate_parse.o
  CC       match.o
  CC       ../lib/strlcpy.o
  CC       ../lib/strlcat.o
  CC       ../lib/lstat.o
  AR       libmatch.a
  CCLD     merecat
make[2]: Leaving directory '/home/jocke/Troglobit/merecat/src'
...
$ file src/merecat
src/merecat: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 4.15.0, with debug_info, not stripped

Btw, you shouldn't have to set CC, the --host=foo argument takes care of that.

@pioneerAlone
Copy link
Author

This is the config.log that I generated by cross compilation.
config.log

@pioneerAlone
Copy link
Author

The possible reason is that my virtual machine is 64-bit, causing cross-compilation to fail, trying to solve this problem. / Configuration succeeded, but new problems appeared afterwards:
../lib/lstat.c: In function 'lstat':
../lib/lstat.c:33: error: 'AT_FDCWD' undeclared (first use in this function)
../lib/lstat.c:33: error: (Each undeclared identifier is reported only once
../lib/lstat.c:33: error: for each function it appears in.)
../lib/lstat.c:33: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function)
Makefile:463: recipe for target '../lib/lstat.o' failed
make[2]: *** [../lib/lstat.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/book/merecat-master/src'
Makefile:472: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/book/merecat-master'
Makefile:348: recipe for target 'all' failed
make: *** [all] Error 2

@troglobit
Copy link
Owner

Both AT_FDCWD and AT_SYMLINK_NOFOLLOW are declared in fcntl.h, which is a standard C-library header file. So not a problem with Merecat but rather your cross compiler/environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants