cross icon indicating copy to clipboard operation
cross copied to clipboard

FreeBSD docker image has headers and libs in wrong place

Open ydirson opened this issue 2 years ago • 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
  • [X] Linux / BSD
  • [ ] other OS (specify in description)

What architecture is the host?

  • [X] x86_64 / AMD64
  • [ ] arm32
  • [ ] arm64 (including Mac M1)

What container engine is cross using?

  • [X] 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

ydirson avatar Nov 09 '23 10:11 ydirson

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

edit: cc #1389

Emilgardis avatar Nov 09 '23 11:11 Emilgardis

fixed with #1403

Emilgardis avatar Aug 17 '24 09:08 Emilgardis