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

Override "--target" for clang build #312

Closed
iskiselev opened this issue May 19, 2023 · 1 comment
Closed

Override "--target" for clang build #312

iskiselev opened this issue May 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@iskiselev
Copy link

Environment and version details

  • Operating System+version: Linux Ubuntu 22.04
  • Compiler+version: Clang 16
  • Shell: Bash
  • B2 Version: B2 Version 4.9. OS=LINUX. B2 4.9-git
  • B2 Configuration: Output of b2 --debug-configuration in your project.
notice: loading B2 from /mnt/c/VSExclude/agent-dotnet-3/build/bin/vcpkg/x64-linux/x64-linux/tools/boost-build/src/kernel/bootstrap.jam
notice: Site configuration files will be ignored due to the
notice: --ignore-site-config command-line option.
notice: Loading explicitly specified user configuration file:
    /mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg/user-config.jam
notice: Searching '/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from '/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg'.
notice: will use '/bin/clang++-16' for clang-linux, condition <toolset>clang-linux-16

Brief problem description

I try to build boost on ubuntu using non-default sysroot (with alpine inside) and overriding setting --target=x86_64-alpine-linux-musl (it is defined in /mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg).
But (due to logic in https://github.com/bfgroup/b2/blob/main/src/tools/clang.jam#L95), it always add --target=x86_64-pc-linux.
Is there any way to not use hardcoded x86_64-pc-linux target?

Steps to reproduce the issue

Next command called:

/mnt/c/VSExclude/agent-dotnet-3/build/bin/vcpkg/x64-linux/x64-linux/tools/boost-build/b2 toolset=clang --user-config=/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg/user-config.jam --stagedir=/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg/stage --build-dir=/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg runtime-link=shared link=static address-model=64 architecture=x86 target-os=linux threadapi=pthread variant=debug --layout=system -sICU_PATH="ICU_PATH-NOTFOUND" --with-atomic --with-random --with-date_time --with-filesystem --with-system --with-thread --with-chrono -j 17 -sBOOST_ROOT=/mnt/c/VSExclude/agent-dotnet-3/build/bin/vcpkg/x64-linux/x64-linux/tools/boost-build -sBOOST_BUILD_PATH=/mnt/c/VSExclude/agent-dotnet-3/build/bin/vcpkg/x64-linux/x64-linux/tools/boost-build --debug-configuration --debug-building --debug-generators --ignore-site-config --hash -q debug-symbols=on -d +2 threading=multi stage --verbose

Actual behavior summary

It call:

  "/bin/clang++-16" -c -x c++ --target=x86_64-alpine-linux-musl -g "--sysroot=/home/ikiselev/alpine" -m64 -pthread -O0 -fno-inline -Wall -g --target=x86_64-pc-linux  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -I"../include" -I"/mnt/c/VSExclude/agent-dotnet-3/build/bin/vcpkg/x64-linux/x64-linux-musl/include"   -o "/mnt/c/VSExclude/agent-dotnet-3/vcpkg/buildtrees/boost-system/x64-linux-musl-dbg/boost/build/343884cf2c124864d23ec3d11d30c6f5/error_code.o" "../src/error_code.cpp"

Expected behavior summary

Only target from user-config.jam passed to clang. No additional hard-coded --target=x86_64-pc-linux added.

@iskiselev iskiselev added the bug Something isn't working label May 19, 2023
@iskiselev iskiselev changed the title Override "--target" fro clang build Override "--target" for clang build Jun 1, 2023
@iskiselev
Copy link
Author

Dup of #255 and #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant