cross-rs/cross

FreeBSD docker image has headers and libs in wrong place

ydirson opened this issue · 1 comments

Checklist

Describe your issue

headers are installed in $SYSROOT/include, when the compiler wants then in $SYSROOT/usr/include (and the same happens for lib).

If we passthrough BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_freebsd="--sysroot=/usr/local/x86_64-unknown-freebsd12 -v" we can see things like:

  --- stderr
  clang version 10.0.0-4ubuntu1 
  Target: x86_64-unknown-freebsd
  Thread model: posix
  InstalledDir: 
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/lib/llvm-10/lib/clang/10.0.0/include
   /usr/local/x86_64-unknown-freebsd12/usr/include
  End of search list.
  /usr/local/x86_64-unknown-freebsd12/usr/include/xenstore_lib.h:25:10: fatal error: 'errno.h' file not found

Workaround: start the pre-build hook with

mkdir -p /usr/local/x86_64-unknown-freebsd12/usr &&
ln -s ../include /usr/local/x86_64-unknown-freebsd12/usr/include &&
ln -s ../lib /usr/local/x86_64-unknown-freebsd12/usr/lib &&

What target(s) are you cross-compiling for?

x86_64-unknown-freebsd

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5 (44011c8 2023-10-23) [note: that's master not 0.2.5]

Example

No response

Additional information / notes

No response

there is also a problem with the BINDGEN_EXTRA_CLANG_ARGS_* for other targets, will have to identify those.

Specifically, I think targets returned by grep -L "ENV CROSS_SYSROOT=/usr/local/" --include='Dockerfile.*' -r ./docker need to be checked