-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 49db4a3, 9f1f010, 4f95c14, c34dc64, 570fdcd, 4bff029 and 6939aee. When relying on Clang config files, two issues appeared: - Running the compiler-rt tests fails, because the compiler-rt tests disable any default config files, breaking the compiler in this case: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.1/compiler-rt/test/lit.common.cfg.py#L983 - Wine fails to build using llvm-mingw as cross compiler, because Wine adds the --no-default-config flag to Clang while compiling, if supported: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/configure.ac?ref_type=tags#L866-868 This causes llvm-mingw to omit the -rtlib=compiler-rt option (specified in a config file), making the compiler look for libgcc instead. Doing a check to see that linking succeeds doesn't necessarily help here - such a check already exists, but it tests linking with -nostdlib -nodefaultlibs: https://gitlab.winehq.org/wine/wine/-/blob/wine-9.19/aclocal.m4?ref_type=tags#L193-L206
- Loading branch information
Showing
14 changed files
with
119 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2024 Martin Storsjo | ||
# | ||
# Permission to use, copy, modify, and/or distribute this software for any | ||
# purpose with or without fee is hereby granted, provided that the above | ||
# copyright notice and this permission notice appear in all copies. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
|
||
get_dir() { | ||
target="$1" | ||
while [ -L "$target" ]; do | ||
cd "$(dirname "$target")" | ||
target="$(readlink "$(basename "$target")")" | ||
done | ||
cd "$(dirname "$target")" | ||
pwd | ||
} | ||
|
||
DIR="$(get_dir "$0")" | ||
|
||
# If changing this wrapper, change clang-scan-deps-wrapper.c accordingly. | ||
EXE="$DIR/clang-scan-deps" | ||
FLAGS=() | ||
while [ $# -gt 0 ]; do | ||
if [ -n "$got_flags" ]; then | ||
CMD_EXE="$1" | ||
FLAGS+=("$1") | ||
shift | ||
break | ||
elif [ "$1" = "--" ]; then | ||
got_flags=1 | ||
FLAGS+=("$1") | ||
else | ||
FLAGS+=("$1") | ||
fi | ||
shift | ||
done | ||
|
||
if [ -n "$CMD_EXE" ]; then | ||
# If CMD_EXE is a <triple>-<exe> style command, pick up the | ||
# target triple from there. | ||
CMD_BASENAME="$(basename "$CMD_EXE")" | ||
CMD_BASENAME="${CMD_BASENAME%.*}" | ||
CMD_TARGET="${CMD_BASENAME%-*}" | ||
CMD_EXE_SUFFIX="${CMD_BASENAME##*-}" | ||
if [ "$CMD_TARGET" != "$CMD_BASENAME" ]; then | ||
case $CMD_EXE_SUFFIX in | ||
clang|clang++|gcc|g++|c++|as|cc|c99|c11) | ||
TARGET="$CMD_TARGET" | ||
;; | ||
esac | ||
fi | ||
fi | ||
|
||
if [ -n "$TARGET" ]; then | ||
"$EXE" "${FLAGS[@]}" -target $TARGET -stdlib=libc++ "$@" | ||
else | ||
"$EXE" "${FLAGS[@]}" "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.