Add --sysroot to the compiler invocation
This makes sure the right sysroot is used, even if e.g. a global system installation of x86_64-w64-mingw32-gcc exists under /usr.
This commit is contained in:
1 parent
3aa5468357
commit
4fc70f4a23
2 files changed
+2
-6
No files matched your search
@@ -45,11 +45,6 @@ normally provides, in the branch `tools`.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If the toolchain is used in an environment that already have got a
|
|
||||||
normal GCC based MinGW toolchain with the same triplet prefix in
|
|
||||||
the same path, you may need to add
|
|
||||||
`--sysroot=path/to/prefix/x86_64-w64-mingw32` to the clang commands.
|
|
||||||
|
|
||||||
Status
|
Status
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
TARGET="$(basename $0 | sed 's/-clang.*//')"
|
TARGET="$(basename $0 | sed 's/-clang.*//')"
|
||||||
EXE=$(basename $0 | sed 's/.*-\(clang.*\)/\1/')
|
EXE=$(basename $0 | sed 's/.*-\(clang.*\)/\1/')
|
||||||
ARCH=$(echo $TARGET | sed 's/-.*//')
|
ARCH=$(echo $TARGET | sed 's/-.*//')
|
||||||
|
SYSROOT="$(cd "$DIR"/../$TARGET && pwd)"
|
||||||
case $ARCH in
|
case $ARCH in
|
||||||
i686)
|
i686)
|
||||||
# Dwarf is the default for i686, but currently there's an issue
|
# Dwarf is the default for i686, but currently there's an issue
|
||||||
@@ -25,4 +26,4 @@ aarch64)
|
|||||||
ARCH_FLAGS=-femulated-tls
|
ARCH_FLAGS=-femulated-tls
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
$DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld $ARCH_FLAGS -Qunused-arguments "$@"
|
$DIR/$EXE -target $TARGET -rtlib=compiler-rt -stdlib=libc++ -fuse-ld=lld --sysroot="$SYSROOT" $ARCH_FLAGS -Qunused-arguments "$@"
|
||||||
Reference in new issue
Block a user