From dfcdc8b22500d840960e63993b4198bce748b597 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 23 Sep 2023 12:10:47 -0400 Subject: [PATCH 01/16] add toolchain shims here * only added if no other toolchain is added * on linux shim through to llvm * on mac shim through to system rationale * reduces hacks in our infra * these are only used with pantry builds * brewkit controls that * everyone expects a C compiler, builds either will work with this or they need to be more specifiuc * for end users removes the surprise of `cc` being some weird hack * end users have to control rpaths themselves and if they are going that low-level then they know what to do * magic is bad --- lib/usePantry.getScript.ts | 4 ++ libexec/stage.ts | 9 +++- share/toolchain/bin/ar | 1 + share/toolchain/bin/as | 1 + share/toolchain/bin/c++ | 1 + share/toolchain/bin/cc | 1 + share/toolchain/bin/ld | 1 + share/toolchain/bin/objcopy | 1 + share/toolchain/bin/ranlib | 1 + share/toolchain/bin/readelf | 1 + share/toolchain/bin/strings | 1 + share/toolchain/bin/strip | 1 + share/toolchain/shim | 86 ++++++++++++++++++++++++++++++++++ share/toolchain/toolchain-shim | 86 ++++++++++++++++++++++++++++++++++ 14 files changed, 193 insertions(+), 2 deletions(-) create mode 120000 share/toolchain/bin/ar create mode 120000 share/toolchain/bin/as create mode 120000 share/toolchain/bin/c++ create mode 120000 share/toolchain/bin/cc create mode 120000 share/toolchain/bin/ld create mode 120000 share/toolchain/bin/objcopy create mode 120000 share/toolchain/bin/ranlib create mode 120000 share/toolchain/bin/readelf create mode 120000 share/toolchain/bin/strings create mode 120000 share/toolchain/bin/strip create mode 100755 share/toolchain/shim create mode 100644 share/toolchain/toolchain-shim diff --git a/lib/usePantry.getScript.ts b/lib/usePantry.getScript.ts index efbd4a76..d27cc406 100644 --- a/lib/usePantry.getScript.ts +++ b/lib/usePantry.getScript.ts @@ -1,3 +1,4 @@ +import useConfig from "libtea/hooks/useConfig.ts" import { SupportedPlatforms } from "https://raw.githubusercontent.com/teaxyz/lib/v0.4.2/src/utils/host.ts" import { isArray, isString, isPlainObject, PlainObject } from "is-what" import { Package, Installation, hooks, utils, semver } from "libtea" @@ -13,6 +14,9 @@ export const getScript = async (pkg: Package, key: 'build' | 'test', deps: Insta const mm = useMoustaches() const script = (input: unknown) => { const tokens = mm.tokenize.all(pkg, deps) + tokens.push({ + from: "build.root", to: useConfig().prefix.string + }) if (isArray(input)) input = input.map(obj => { if (isPlainObject(obj)) { diff --git a/libexec/stage.ts b/libexec/stage.ts index 07aca917..6a943b57 100755 --- a/libexec/stage.ts +++ b/libexec/stage.ts @@ -56,7 +56,12 @@ const pkg = await pantry.resolve(parse(pkgname)) /// assemble build script const pantry_sh = await pantry.getScript(pkg, 'build', deps) -const brewkit = new Path(new URL(import.meta.url).pathname).parent().parent().join("share/brewkit") +const sup_PATH = [new Path(new URL(import.meta.url).pathname).parent().parent().join("share/brewkit")] + +if (!deps.find(({pkg}) => pkg.project == 'llvm.org' || pkg.project == 'gnu.org/gcc')) { + /// add our helper cc toolchain unless the package has picked its own toolchain + sup_PATH.push(new Path(new URL(import.meta.url).pathname).parent().parent().join("share/toolchain/bin")) +} /// calc env const sh = useShellEnv() @@ -86,7 +91,7 @@ const text = undent` mkdir -p "$HOME" - export PATH=${brewkit}:"$PATH" + export PATH=${sup_PATH.map(x => x.string).join(':')}:"$PATH" export CFLAGS="-w $CFLAGS" # warnings are noise ${pantry_sh} diff --git a/share/toolchain/bin/ar b/share/toolchain/bin/ar new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/ar @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/as b/share/toolchain/bin/as new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/as @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/c++ b/share/toolchain/bin/c++ new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/c++ @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/cc b/share/toolchain/bin/cc new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/cc @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/ld b/share/toolchain/bin/ld new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/ld @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/objcopy b/share/toolchain/bin/objcopy new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/objcopy @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/ranlib b/share/toolchain/bin/ranlib new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/ranlib @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/readelf b/share/toolchain/bin/readelf new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/readelf @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/strings b/share/toolchain/bin/strings new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/strings @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/strip b/share/toolchain/bin/strip new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/strip @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/shim b/share/toolchain/shim new file mode 100755 index 00000000..0eaadcbf --- /dev/null +++ b/share/toolchain/shim @@ -0,0 +1,86 @@ +#!/bin/sh + +tool=$(basename $0) + +if [ $(uname) != Darwin ]; then + exec tea +llvm.org $tool "$@" +fi + +case $tool in +cc|gcc|clang|c++|g++|clang++) + exec ruby $0 "$@" + ;; +ld|lld|lld-link|ld64.lld) + for word in "$@"; do + if test "$word" = -r; then + exec /usr/bin/"$tool" "$@" + fi + done + + exec /usr/bin/$tool "$@" -rpath "${TEA_PREFIX:-$HOME/.tea}" + ;; +*) + exec /usr/bin/$tool "$@" + ;; +esac + + +#!/usr/bin/ruby + +# - we inject our rpath to ensure our libs our found +# - for bottles we replace that in fix-machos.rb with a relocatable prefix +# - in general usage we don’t, so if the user needs to distribute their artifacts, +# they will need to fix them first, but that's typical anyway. +# - for tea-envs the user probably won’t use tea.xyz/gx/cc even though they *should* +# and thus we set LDFLAGS in the hope that they will be picked up and the rpath set + +$tea_prefix = ENV['TEA_PREFIX'] || (ENV['HOME'] + "/.tea") +exe = File.basename($0) + +# remove duplicates since this in fact embeds the rpath multiple times +# and omit -nodefaultrpaths since it is not a valid flag for clang +args = ARGV.map do |arg| + arg unless arg == "-Wl,-rpath,#$tea_prefix" or arg == "-nodefaultrpaths" +end.compact + +def is_tea? path + path = File.realpath path while File.symlink? path + return File.basename(path) == "tea" +end + +# find next example of ourselves +# this will either pick the Apple provided clang or the tea one +exe_path = ENV['PATH'].split(":").filter { |path| + if path == File.dirname(__FILE__) + false + elsif path == File.join($tea_prefix, ".local/bin") + false + elsif is_tea?(path) + false + else + true + end +}.map { |path| + "#{path}/#{exe}" +}.reject { |path| + # if the user created a symlink of `cc` to `tea` don’t use it + File.symlink? path and File.basename(File.readlink(path)) == "tea" +}.find { |path| + File.exist?(path) +} + +abort "couldn’t find #{exe} in `PATH`" unless exe_path + +for arg in args do + # figuring out what “mode” we are operating in is hard + # we don’t want to add this linker command always because it causes a warning to be + # output if we are not outputing executables/dylibs and this warning can break + # configure scripts, however the below is not fully encompassing + # we aren't sure what the rules are TBH, possibly it is as simple as if the output (`-o`) + # is a .o then we don’t add the rpath + if arg.start_with? '-l' or arg.end_with? '.dylib' + exec exe_path, *args, "-Wl,-rpath,#$tea_prefix" + end +end + +exec exe_path, *args diff --git a/share/toolchain/toolchain-shim b/share/toolchain/toolchain-shim new file mode 100644 index 00000000..bcd0a3b4 --- /dev/null +++ b/share/toolchain/toolchain-shim @@ -0,0 +1,86 @@ +#!/bin/sh + +tool=$(basename $0) + +if [ $(uname) != Darwin ]; then + exec tea +llvm.org $tool "$@" +fi + +case $tool in +cc|c++) + exec ruby $0 "$@" + ;; +ld|lld|lld-link|ld64.lld) + for word in "$@"; do + if test "$word" = -r; then + exec /usr/bin/"$tool" "$@" + fi + done + + exec /usr/bin/$tool "$@" -rpath "${TEA_PREFIX:-$HOME/.tea}" + ;; +*) + exec /usr/bin/$tool "$@" + ;; +esac + + +#!/usr/bin/ruby + +# - we inject our rpath to ensure our libs our found +# - for bottles we replace that in fix-machos.rb with a relocatable prefix +# - in general usage we don’t, so if the user needs to distribute their artifacts, +# they will need to fix them first, but that's typical anyway. +# - for tea-envs the user probably won’t use tea.xyz/gx/cc even though they *should* +# and thus we set LDFLAGS in the hope that they will be picked up and the rpath set + +$tea_prefix = ENV['TEA_PREFIX'] || (ENV['HOME'] + "/.tea") +exe = File.basename($0) + +# remove duplicates since this in fact embeds the rpath multiple times +# and omit -nodefaultrpaths since it is not a valid flag for clang +args = ARGV.map do |arg| + arg unless arg == "-Wl,-rpath,#$tea_prefix" or arg == "-nodefaultrpaths" +end.compact + +def is_tea? path + path = File.realpath path while File.symlink? path + return File.basename(path) == "tea" +end + +# find next example of ourselves +# this will either pick the Apple provided clang or the tea one +exe_path = ENV['PATH'].split(":").filter { |path| + if path == File.dirname(__FILE__) + false + elsif path == File.join($tea_prefix, ".local/bin") + false + elsif is_tea?(path) + false + else + true + end +}.map { |path| + "#{path}/#{exe}" +}.reject { |path| + # if the user created a symlink of `cc` to `tea` don’t use it + File.symlink? path and File.basename(File.readlink(path)) == "tea" +}.find { |path| + File.exist?(path) +} + +abort "couldn’t find #{exe} in `PATH`" unless exe_path + +for arg in args do + # figuring out what “mode” we are operating in is hard + # we don’t want to add this linker command always because it causes a warning to be + # output if we are not outputing executables/dylibs and this warning can break + # configure scripts, however the below is not fully encompassing + # we aren't sure what the rules are TBH, possibly it is as simple as if the output (`-o`) + # is a .o then we don’t add the rpath + if arg.start_with? '-l' or arg.end_with? '.dylib' + exec exe_path, *args, "-Wl,-rpath,#$tea_prefix" + end +end + +exec exe_path, *args From 00e7580d258386763782b7a2596257d79c77c845 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 23 Sep 2023 13:06:33 -0400 Subject: [PATCH 02/16] wip --- libexec/stage-test.ts | 5 +++++ share/toolchain/bin/make | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100755 share/toolchain/bin/make diff --git a/libexec/stage-test.ts b/libexec/stage-test.ts index 985ef6e2..add334be 100755 --- a/libexec/stage-test.ts +++ b/libexec/stage-test.ts @@ -43,6 +43,11 @@ if (!yml.test) throw "no `test` node in package.yml" env['PATH'] ??= [] env['PATH'].push("/usr/bin:/bin") +if (!deps.find(({pkg}) => pkg.project == 'llvm.org' || pkg.project == 'gnu.org/gcc')) { + /// add our helper cc toolchain unless the package has picked its own toolchain + env['PATH'].push(new Path(new URL(import.meta.url).pathname).parent().parent().join("share/toolchain/bin").string) +} + let text = undent` #!/usr/bin/env bash diff --git a/share/toolchain/bin/make b/share/toolchain/bin/make new file mode 100755 index 00000000..57778f70 --- /dev/null +++ b/share/toolchain/bin/make @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ $(uname) = Darwin ]; then + exec /usr/bin/make "$@" +else + tea +gnu.org/make make "$@" +fi From 3a313186999884b271d94abe1e385caf2fc14110 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 23 Sep 2023 13:48:10 -0400 Subject: [PATCH 03/16] wip --- share/toolchain/bin/clang | 1 + share/toolchain/bin/clang++ | 1 + 2 files changed, 2 insertions(+) create mode 120000 share/toolchain/bin/clang create mode 120000 share/toolchain/bin/clang++ diff --git a/share/toolchain/bin/clang b/share/toolchain/bin/clang new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/clang @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/clang++ b/share/toolchain/bin/clang++ new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/clang++ @@ -0,0 +1 @@ +../shim \ No newline at end of file From 347b0e43fece98c00f1c3c0f750f2a812e0c028f Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 10:57:22 -0400 Subject: [PATCH 04/16] wip --- share/.DS_Store | Bin 0 -> 6148 bytes share/toolchain/.DS_Store | Bin 0 -> 6148 bytes share/toolchain/bin/clang-cpp | 1 + share/toolchain/bin/cpp | 1 + share/toolchain/bin/g++ | 1 + share/toolchain/bin/gcc | 1 + share/toolchain/bin/ld64.lld | 1 + share/toolchain/bin/lld | 1 + share/toolchain/bin/lld-link | 1 + share/toolchain/bin/make | 2 +- share/toolchain/bin/nm | 1 + share/toolchain/shim | 3 +- share/toolchain/symlinks/ar | 1 + share/toolchain/symlinks/as | 1 + share/toolchain/symlinks/c++ | 1 + share/toolchain/symlinks/cc | 1 + share/toolchain/symlinks/clang | 1 + share/toolchain/symlinks/clang++ | 1 + share/toolchain/symlinks/clang-cpp | 1 + share/toolchain/symlinks/cpp | 1 + share/toolchain/symlinks/g++ | 1 + share/toolchain/symlinks/gcc | 1 + share/toolchain/symlinks/ld | 1 + share/toolchain/symlinks/ld64.lld | 1 + share/toolchain/symlinks/lld | 1 + share/toolchain/symlinks/lld-link | 1 + share/toolchain/symlinks/nm | 1 + share/toolchain/symlinks/objcopy | 1 + share/toolchain/symlinks/ranlib | 1 + share/toolchain/symlinks/readelf | 1 + share/toolchain/symlinks/strings | 1 + share/toolchain/symlinks/strip | 1 + share/toolchain/toolchain-shim | 86 ----------------------------- 33 files changed, 31 insertions(+), 88 deletions(-) create mode 100644 share/.DS_Store create mode 100644 share/toolchain/.DS_Store create mode 120000 share/toolchain/bin/clang-cpp create mode 120000 share/toolchain/bin/cpp create mode 120000 share/toolchain/bin/g++ create mode 120000 share/toolchain/bin/gcc create mode 120000 share/toolchain/bin/ld64.lld create mode 120000 share/toolchain/bin/lld create mode 120000 share/toolchain/bin/lld-link create mode 120000 share/toolchain/bin/nm create mode 120000 share/toolchain/symlinks/ar create mode 120000 share/toolchain/symlinks/as create mode 120000 share/toolchain/symlinks/c++ create mode 120000 share/toolchain/symlinks/cc create mode 120000 share/toolchain/symlinks/clang create mode 120000 share/toolchain/symlinks/clang++ create mode 120000 share/toolchain/symlinks/clang-cpp create mode 120000 share/toolchain/symlinks/cpp create mode 120000 share/toolchain/symlinks/g++ create mode 120000 share/toolchain/symlinks/gcc create mode 120000 share/toolchain/symlinks/ld create mode 120000 share/toolchain/symlinks/ld64.lld create mode 120000 share/toolchain/symlinks/lld create mode 120000 share/toolchain/symlinks/lld-link create mode 120000 share/toolchain/symlinks/nm create mode 120000 share/toolchain/symlinks/objcopy create mode 120000 share/toolchain/symlinks/ranlib create mode 120000 share/toolchain/symlinks/readelf create mode 120000 share/toolchain/symlinks/strings create mode 120000 share/toolchain/symlinks/strip delete mode 100644 share/toolchain/toolchain-shim diff --git a/share/.DS_Store b/share/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a164a8dee38ab8ff5ece9d9847998ab795e2ae90 GIT binary patch literal 6148 zcmeHKOG*P#5UkcLB5tzG@?F6jJVHD{E}$4NLYRQ4>sjSo9?j|xVwkuIxRL6iyWZ>R zdc)LWdK!SO-nVza0>GT^h@*$8`F;0^T~)@2be{2q9Uk$5;bSwYKA&*z4c>6zwg1U~ z9rlOeIZr-MRaOc}0VyB_q<|E-KmqT)wE1nKq7;wR+`j)_T!)$n2UWUC3q;^{oUMLDb|DoOz< zaH_y{ZWrGF@9DqH|EDDFq<|FoR|?o{y;-mLO4VB@FXz3s(I4nu^GSE(Iw%a$j)~EZ hx$${Ui7<)U`V$U?icH=9+D ztM#&~*J|^!nl);bvN~!U&gTWWvwv`M-tI?(SU+1f1%7x&wj3_t1&x)BJ^G_K((ygU z7Ilk!MrME+UtSJm4&;Z2(vo+l}QKTS>%x!U{ a8bQAz1JQGsT0{>D{|Fcwcwh#8m4SD`Jx!PZ literal 0 HcmV?d00001 diff --git a/share/toolchain/bin/clang-cpp b/share/toolchain/bin/clang-cpp new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/clang-cpp @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/cpp b/share/toolchain/bin/cpp new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/cpp @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/g++ b/share/toolchain/bin/g++ new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/g++ @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/gcc b/share/toolchain/bin/gcc new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/gcc @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/ld64.lld b/share/toolchain/bin/ld64.lld new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/ld64.lld @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/lld b/share/toolchain/bin/lld new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/lld @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/lld-link b/share/toolchain/bin/lld-link new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/lld-link @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/bin/make b/share/toolchain/bin/make index 57778f70..b6682e4f 100755 --- a/share/toolchain/bin/make +++ b/share/toolchain/bin/make @@ -3,5 +3,5 @@ if [ $(uname) = Darwin ]; then exec /usr/bin/make "$@" else - tea +gnu.org/make make "$@" + exec tea +gnu.org/make make "$@" fi diff --git a/share/toolchain/bin/nm b/share/toolchain/bin/nm new file mode 120000 index 00000000..075dad11 --- /dev/null +++ b/share/toolchain/bin/nm @@ -0,0 +1 @@ +../shim \ No newline at end of file diff --git a/share/toolchain/shim b/share/toolchain/shim index 0eaadcbf..d7393998 100755 --- a/share/toolchain/shim +++ b/share/toolchain/shim @@ -3,7 +3,8 @@ tool=$(basename $0) if [ $(uname) != Darwin ]; then - exec tea +llvm.org $tool "$@" + d="$(cd "$(basename "$0")" && pwd)" + exec tea +llvm.org $d/symlinks/$tool "$@" fi case $tool in diff --git a/share/toolchain/symlinks/ar b/share/toolchain/symlinks/ar new file mode 120000 index 00000000..025048eb --- /dev/null +++ b/share/toolchain/symlinks/ar @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/ar \ No newline at end of file diff --git a/share/toolchain/symlinks/as b/share/toolchain/symlinks/as new file mode 120000 index 00000000..14ea9846 --- /dev/null +++ b/share/toolchain/symlinks/as @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/as \ No newline at end of file diff --git a/share/toolchain/symlinks/c++ b/share/toolchain/symlinks/c++ new file mode 120000 index 00000000..c53ae31e --- /dev/null +++ b/share/toolchain/symlinks/c++ @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/c++ \ No newline at end of file diff --git a/share/toolchain/symlinks/cc b/share/toolchain/symlinks/cc new file mode 120000 index 00000000..64bcdb33 --- /dev/null +++ b/share/toolchain/symlinks/cc @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/cc \ No newline at end of file diff --git a/share/toolchain/symlinks/clang b/share/toolchain/symlinks/clang new file mode 120000 index 00000000..ea846fc8 --- /dev/null +++ b/share/toolchain/symlinks/clang @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/clang \ No newline at end of file diff --git a/share/toolchain/symlinks/clang++ b/share/toolchain/symlinks/clang++ new file mode 120000 index 00000000..ac32278b --- /dev/null +++ b/share/toolchain/symlinks/clang++ @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/clang++ \ No newline at end of file diff --git a/share/toolchain/symlinks/clang-cpp b/share/toolchain/symlinks/clang-cpp new file mode 120000 index 00000000..50db15c2 --- /dev/null +++ b/share/toolchain/symlinks/clang-cpp @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/clang-cpp \ No newline at end of file diff --git a/share/toolchain/symlinks/cpp b/share/toolchain/symlinks/cpp new file mode 120000 index 00000000..a9b8ef28 --- /dev/null +++ b/share/toolchain/symlinks/cpp @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/cpp \ No newline at end of file diff --git a/share/toolchain/symlinks/g++ b/share/toolchain/symlinks/g++ new file mode 120000 index 00000000..72a6e696 --- /dev/null +++ b/share/toolchain/symlinks/g++ @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/g++ \ No newline at end of file diff --git a/share/toolchain/symlinks/gcc b/share/toolchain/symlinks/gcc new file mode 120000 index 00000000..c2bfaebf --- /dev/null +++ b/share/toolchain/symlinks/gcc @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/gcc \ No newline at end of file diff --git a/share/toolchain/symlinks/ld b/share/toolchain/symlinks/ld new file mode 120000 index 00000000..07c7b3fb --- /dev/null +++ b/share/toolchain/symlinks/ld @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/ld \ No newline at end of file diff --git a/share/toolchain/symlinks/ld64.lld b/share/toolchain/symlinks/ld64.lld new file mode 120000 index 00000000..e7be47ec --- /dev/null +++ b/share/toolchain/symlinks/ld64.lld @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/ld64.lld \ No newline at end of file diff --git a/share/toolchain/symlinks/lld b/share/toolchain/symlinks/lld new file mode 120000 index 00000000..d5bf90be --- /dev/null +++ b/share/toolchain/symlinks/lld @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/lld \ No newline at end of file diff --git a/share/toolchain/symlinks/lld-link b/share/toolchain/symlinks/lld-link new file mode 120000 index 00000000..9d31d258 --- /dev/null +++ b/share/toolchain/symlinks/lld-link @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/lld-link \ No newline at end of file diff --git a/share/toolchain/symlinks/nm b/share/toolchain/symlinks/nm new file mode 120000 index 00000000..3b20da51 --- /dev/null +++ b/share/toolchain/symlinks/nm @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/nm \ No newline at end of file diff --git a/share/toolchain/symlinks/objcopy b/share/toolchain/symlinks/objcopy new file mode 120000 index 00000000..a2abc711 --- /dev/null +++ b/share/toolchain/symlinks/objcopy @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/objcopy \ No newline at end of file diff --git a/share/toolchain/symlinks/ranlib b/share/toolchain/symlinks/ranlib new file mode 120000 index 00000000..3befc1b9 --- /dev/null +++ b/share/toolchain/symlinks/ranlib @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/ranlib \ No newline at end of file diff --git a/share/toolchain/symlinks/readelf b/share/toolchain/symlinks/readelf new file mode 120000 index 00000000..e00765e6 --- /dev/null +++ b/share/toolchain/symlinks/readelf @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/readelf \ No newline at end of file diff --git a/share/toolchain/symlinks/strings b/share/toolchain/symlinks/strings new file mode 120000 index 00000000..fdc28ac0 --- /dev/null +++ b/share/toolchain/symlinks/strings @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/strings \ No newline at end of file diff --git a/share/toolchain/symlinks/strip b/share/toolchain/symlinks/strip new file mode 120000 index 00000000..d2949105 --- /dev/null +++ b/share/toolchain/symlinks/strip @@ -0,0 +1 @@ +../../../../../llvm.org/v*/bin/strip \ No newline at end of file diff --git a/share/toolchain/toolchain-shim b/share/toolchain/toolchain-shim deleted file mode 100644 index bcd0a3b4..00000000 --- a/share/toolchain/toolchain-shim +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/sh - -tool=$(basename $0) - -if [ $(uname) != Darwin ]; then - exec tea +llvm.org $tool "$@" -fi - -case $tool in -cc|c++) - exec ruby $0 "$@" - ;; -ld|lld|lld-link|ld64.lld) - for word in "$@"; do - if test "$word" = -r; then - exec /usr/bin/"$tool" "$@" - fi - done - - exec /usr/bin/$tool "$@" -rpath "${TEA_PREFIX:-$HOME/.tea}" - ;; -*) - exec /usr/bin/$tool "$@" - ;; -esac - - -#!/usr/bin/ruby - -# - we inject our rpath to ensure our libs our found -# - for bottles we replace that in fix-machos.rb with a relocatable prefix -# - in general usage we don’t, so if the user needs to distribute their artifacts, -# they will need to fix them first, but that's typical anyway. -# - for tea-envs the user probably won’t use tea.xyz/gx/cc even though they *should* -# and thus we set LDFLAGS in the hope that they will be picked up and the rpath set - -$tea_prefix = ENV['TEA_PREFIX'] || (ENV['HOME'] + "/.tea") -exe = File.basename($0) - -# remove duplicates since this in fact embeds the rpath multiple times -# and omit -nodefaultrpaths since it is not a valid flag for clang -args = ARGV.map do |arg| - arg unless arg == "-Wl,-rpath,#$tea_prefix" or arg == "-nodefaultrpaths" -end.compact - -def is_tea? path - path = File.realpath path while File.symlink? path - return File.basename(path) == "tea" -end - -# find next example of ourselves -# this will either pick the Apple provided clang or the tea one -exe_path = ENV['PATH'].split(":").filter { |path| - if path == File.dirname(__FILE__) - false - elsif path == File.join($tea_prefix, ".local/bin") - false - elsif is_tea?(path) - false - else - true - end -}.map { |path| - "#{path}/#{exe}" -}.reject { |path| - # if the user created a symlink of `cc` to `tea` don’t use it - File.symlink? path and File.basename(File.readlink(path)) == "tea" -}.find { |path| - File.exist?(path) -} - -abort "couldn’t find #{exe} in `PATH`" unless exe_path - -for arg in args do - # figuring out what “mode” we are operating in is hard - # we don’t want to add this linker command always because it causes a warning to be - # output if we are not outputing executables/dylibs and this warning can break - # configure scripts, however the below is not fully encompassing - # we aren't sure what the rules are TBH, possibly it is as simple as if the output (`-o`) - # is a .o then we don’t add the rpath - if arg.start_with? '-l' or arg.end_with? '.dylib' - exec exe_path, *args, "-Wl,-rpath,#$tea_prefix" - end -end - -exec exe_path, *args From 126606ec936cd84cacca6b061ecdc24e7ac9d0fa Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:07:47 -0400 Subject: [PATCH 05/16] wip --- .github/workflows/ci.yml | 7 +++---- share/.DS_Store | Bin 6148 -> 6148 bytes 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8489c3cc..c9843f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - catb.org/wumpus - c-ares.org - vim.org - - tea.xyz/gx/cc # FIXME? requires a darwin platform to run, and needs # macOS 12 to test. That'll require a more complex matrix # using get-platform. @@ -26,11 +25,11 @@ jobs: container: image: debian:buster-slim steps: - - uses: actions/checkout@v3 - uses: teaxyz/setup@v0 - - name: configure PATH - run: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH + - uses: actions/checkout@v3 + with: + path: ${{ env.HOME }}/.tea/tea.xyz/brewkit/v* - uses: actions/cache@v3 with: diff --git a/share/.DS_Store b/share/.DS_Store index a164a8dee38ab8ff5ece9d9847998ab795e2ae90..2d42a62b9271957c68be709b5bed2105a88e09c2 100644 GIT binary patch delta 312 zcmZoMXfc=|#>B)qu~2NHo}wrd0|Nsi1A_nqLo!1KLn1>aLtaw(#*NDvCmV>c)N?YF zFysSa4zg@VgHq=KBx;t~UcYm7|HEUawo9PAw29I?R}`Q^bSi6y1QPKia) zAYMp*eohjMotPAsnOYt%AmW^#SCW{Sms$kYkeQMSR1y=OnU|7Z?v!7emr@)Zi6q0p z$-x;fAX!~)WMF2bqhM}qQmdm-ZE0knqhMxXSX;}CJzu~2NHo}wrt0|NsP3otMwGh{F%GGsF3l?6{MRA*$|{G3UFb+ZC< nG}C5w4t@@xmd%39- Date: Fri, 29 Sep 2023 11:15:43 -0400 Subject: [PATCH 06/16] wip --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9843f4c..78ab5ec9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,12 @@ jobs: - uses: actions/checkout@v3 with: - path: ${{ env.HOME }}/.tea/tea.xyz/brewkit/v* + path: co + + - name: install brewkit + run: | + mkdir -p $HOME/.tea/tea.xyz/brewkit + mv co "$HOME/.tea/tea.xyz/brewkit/v*" - uses: actions/cache@v3 with: From 728456bf9901e7705ece6f408f0a4a49ac4beddd Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:18:37 -0400 Subject: [PATCH 07/16] wip --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78ab5ec9..9cd17015 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,16 +25,14 @@ jobs: container: image: debian:buster-slim steps: - - uses: teaxyz/setup@v0 - - uses: actions/checkout@v3 - with: - path: co + + - uses: teaxyz/setup@v0 - name: install brewkit run: | - mkdir -p $HOME/.tea/tea.xyz/brewkit - mv co "$HOME/.tea/tea.xyz/brewkit/v*" + mkdir -p "$HOME/.tea/tea.xyz/brewkit/v*" + mv * "$HOME/.tea/tea.xyz/brewkit/v*" - uses: actions/cache@v3 with: From 8dab640d5b113afdcd157f9d9cde35a1b1598f47 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:24:23 -0400 Subject: [PATCH 08/16] wip --- .github/workflows/ci.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cd17015..47671991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,21 +29,16 @@ jobs: - uses: teaxyz/setup@v0 + - name: prefetch deno deps + # this makes the output from the build step more legible + run: deno cache **/*.ts + - name: install brewkit run: | mkdir -p "$HOME/.tea/tea.xyz/brewkit/v*" mv * "$HOME/.tea/tea.xyz/brewkit/v*" - - uses: actions/cache@v3 - with: - path: ${{ env.HOME }}/.cache/deno - key: deno-get-platform-${{ hashFiles('deno.jsonc')}} - - - name: prefetch deno deps - # this makes the output from the build step more legible - run: deno cache **/*.ts - - - run: pkg build ${{matrix.pkgs}} + - run: tea pkg build ${{matrix.pkgs}} id: build - run: test -n '${{ steps.build.outputs.pkgs }}' From 9996a0859e86fcd8bde79777802deaf956225b14 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:27:16 -0400 Subject: [PATCH 09/16] wip --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47671991..f0059cb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,14 @@ jobs: run: | mkdir -p "$HOME/.tea/tea.xyz/brewkit/v*" mv * "$HOME/.tea/tea.xyz/brewkit/v*" + echo "$HOME/.tea/tea.xyz/brewkit/v*" >> $GITHUB_PATH - - run: tea pkg build ${{matrix.pkgs}} + - run: pkg build ${{matrix.pkgs}} id: build - run: test -n '${{ steps.build.outputs.pkgs }}' - run: test -n '${{ steps.build.outputs.relative-paths }}' + - run: | if pkg query ${{ steps.build.outputs.pkgs }} --src 2>&1 | grep -E '^warn: pkg has no srcs:'; then echo "srcs=false" >> $GITHUB_OUTPUT @@ -50,8 +52,10 @@ jobs: echo "srcs=true" >> $GITHUB_OUTPUT fi id: srcs - - run: test -n '${{ steps.build.outputs.srcs }}' + - + run: test -n '${{ steps.build.outputs.srcs }}' if: steps.srcs.outputs.srcs == 'true' + - run: test -n '${{ steps.build.outputs.srcs-relative-paths }}' if: steps.srcs.outputs.srcs == 'true' From e8d33433bb9f99a49ced35d04dd13d4b48a9882c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:28:30 -0400 Subject: [PATCH 10/16] wip --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0059cb7..ee1f8655 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,10 @@ jobs: image: debian:buster-slim steps: - uses: actions/checkout@v3 - - uses: teaxyz/setup@v0 - - name: prefetch deno deps - # this makes the output from the build step more legible - run: deno cache **/*.ts + # prefetch dneo deps to make the output from the build step more legible + - run: deno cache **/*.ts - name: install brewkit run: | @@ -52,8 +50,8 @@ jobs: echo "srcs=true" >> $GITHUB_OUTPUT fi id: srcs - - - run: test -n '${{ steps.build.outputs.srcs }}' + + - run: test -n '${{ steps.build.outputs.srcs }}' if: steps.srcs.outputs.srcs == 'true' - run: test -n '${{ steps.build.outputs.srcs-relative-paths }}' From 8233b44e2deeeec845a969050db46f9c1235964b Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:31:44 -0400 Subject: [PATCH 11/16] wip --- share/TEMPLATE.pkg.yml | 9 ++++----- share/toolchain/shim | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/share/TEMPLATE.pkg.yml b/share/TEMPLATE.pkg.yml index 74acf192..d4d1a88d 100644 --- a/share/TEMPLATE.pkg.yml +++ b/share/TEMPLATE.pkg.yml @@ -80,14 +80,13 @@ dependencies: build: dependencies: - tea.xyz/gx/cc: c99 - tea.xyz/gx/make: '*' - # ^^ often packages need dependencies to build, it is very common for - # packages to need a C compiler and make, the above provide those + cmake.org: ^3 + # ^^ we provide a c compiler and make by default, other deps you’ll need to add yourself + script: | ./configure $ARGS make --jobs {{ hw.concurrency }} install - # it’s extremely common for packages to require the above + # ^^ it’s extremely common for packages to require the above # script also supports a list of commands, which is useful for complex builds # or if you want to run a command in a different directory diff --git a/share/toolchain/shim b/share/toolchain/shim index d7393998..80c24639 100755 --- a/share/toolchain/shim +++ b/share/toolchain/shim @@ -32,8 +32,6 @@ esac # - for bottles we replace that in fix-machos.rb with a relocatable prefix # - in general usage we don’t, so if the user needs to distribute their artifacts, # they will need to fix them first, but that's typical anyway. -# - for tea-envs the user probably won’t use tea.xyz/gx/cc even though they *should* -# and thus we set LDFLAGS in the hope that they will be picked up and the rpath set $tea_prefix = ENV['TEA_PREFIX'] || (ENV['HOME'] + "/.tea") exe = File.basename($0) From 5d82e5da50ddceb4859edbea97bbcc98e1aa83b2 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:32:43 -0400 Subject: [PATCH 12/16] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee1f8655..3a233c3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | mkdir -p "$HOME/.tea/tea.xyz/brewkit/v*" mv * "$HOME/.tea/tea.xyz/brewkit/v*" - echo "$HOME/.tea/tea.xyz/brewkit/v*" >> $GITHUB_PATH + echo "$HOME/.tea/tea.xyz/brewkit/v*/bin" >> $GITHUB_PATH - run: pkg build ${{matrix.pkgs}} id: build From 29ae5928ad57c24c874ca624d9aa3f36f46b4a35 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:37:37 -0400 Subject: [PATCH 13/16] wip --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a233c3b..88ccda09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,9 @@ jobs: - uses: actions/checkout@v3 - uses: teaxyz/setup@v0 + - run: | + find ~/.tea/tea.xyz/var/pantry -name 'package.yml' -exec sed -i '/tea\.xyz\/gx\/cc: c99/d' {} \; + # prefetch dneo deps to make the output from the build step more legible - run: deno cache **/*.ts From 042243d3561072d5357e31ce236bd1bbf7c61e76 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 11:57:07 -0400 Subject: [PATCH 14/16] wip --- share/toolchain/bin/clang-cpp | 1 - share/toolchain/symlinks/ar | 2 +- share/toolchain/symlinks/as | 2 +- share/toolchain/symlinks/c++ | 2 +- share/toolchain/symlinks/cc | 2 +- share/toolchain/symlinks/clang | 2 +- share/toolchain/symlinks/clang++ | 2 +- share/toolchain/symlinks/clang-cpp | 1 - share/toolchain/symlinks/cpp | 2 +- share/toolchain/symlinks/g++ | 2 +- share/toolchain/symlinks/gcc | 2 +- share/toolchain/symlinks/ld | 2 +- share/toolchain/symlinks/ld64.lld | 2 +- share/toolchain/symlinks/lld | 2 +- share/toolchain/symlinks/lld-link | 2 +- share/toolchain/symlinks/nm | 2 +- share/toolchain/symlinks/objcopy | 2 +- share/toolchain/symlinks/ranlib | 2 +- share/toolchain/symlinks/readelf | 2 +- share/toolchain/symlinks/strings | 2 +- share/toolchain/symlinks/strip | 2 +- 21 files changed, 19 insertions(+), 21 deletions(-) delete mode 120000 share/toolchain/bin/clang-cpp delete mode 120000 share/toolchain/symlinks/clang-cpp diff --git a/share/toolchain/bin/clang-cpp b/share/toolchain/bin/clang-cpp deleted file mode 120000 index 075dad11..00000000 --- a/share/toolchain/bin/clang-cpp +++ /dev/null @@ -1 +0,0 @@ -../shim \ No newline at end of file diff --git a/share/toolchain/symlinks/ar b/share/toolchain/symlinks/ar index 025048eb..d03f9ca4 120000 --- a/share/toolchain/symlinks/ar +++ b/share/toolchain/symlinks/ar @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/ar \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-ar \ No newline at end of file diff --git a/share/toolchain/symlinks/as b/share/toolchain/symlinks/as index 14ea9846..6282f5f0 120000 --- a/share/toolchain/symlinks/as +++ b/share/toolchain/symlinks/as @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/as \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-as \ No newline at end of file diff --git a/share/toolchain/symlinks/c++ b/share/toolchain/symlinks/c++ index c53ae31e..be134fe6 120000 --- a/share/toolchain/symlinks/c++ +++ b/share/toolchain/symlinks/c++ @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/c++ \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang++ \ No newline at end of file diff --git a/share/toolchain/symlinks/cc b/share/toolchain/symlinks/cc index 64bcdb33..fec4d088 120000 --- a/share/toolchain/symlinks/cc +++ b/share/toolchain/symlinks/cc @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/cc \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang \ No newline at end of file diff --git a/share/toolchain/symlinks/clang b/share/toolchain/symlinks/clang index ea846fc8..fec4d088 120000 --- a/share/toolchain/symlinks/clang +++ b/share/toolchain/symlinks/clang @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/clang \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang \ No newline at end of file diff --git a/share/toolchain/symlinks/clang++ b/share/toolchain/symlinks/clang++ index ac32278b..be134fe6 120000 --- a/share/toolchain/symlinks/clang++ +++ b/share/toolchain/symlinks/clang++ @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/clang++ \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang++ \ No newline at end of file diff --git a/share/toolchain/symlinks/clang-cpp b/share/toolchain/symlinks/clang-cpp deleted file mode 120000 index 50db15c2..00000000 --- a/share/toolchain/symlinks/clang-cpp +++ /dev/null @@ -1 +0,0 @@ -../../../../../llvm.org/v*/bin/clang-cpp \ No newline at end of file diff --git a/share/toolchain/symlinks/cpp b/share/toolchain/symlinks/cpp index a9b8ef28..fd140024 120000 --- a/share/toolchain/symlinks/cpp +++ b/share/toolchain/symlinks/cpp @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/cpp \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang-cpp \ No newline at end of file diff --git a/share/toolchain/symlinks/g++ b/share/toolchain/symlinks/g++ index 72a6e696..be134fe6 120000 --- a/share/toolchain/symlinks/g++ +++ b/share/toolchain/symlinks/g++ @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/g++ \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang++ \ No newline at end of file diff --git a/share/toolchain/symlinks/gcc b/share/toolchain/symlinks/gcc index c2bfaebf..fec4d088 120000 --- a/share/toolchain/symlinks/gcc +++ b/share/toolchain/symlinks/gcc @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/gcc \ No newline at end of file +../../../../../../llvm.org/v*/bin/clang \ No newline at end of file diff --git a/share/toolchain/symlinks/ld b/share/toolchain/symlinks/ld index 07c7b3fb..72b7a64d 120000 --- a/share/toolchain/symlinks/ld +++ b/share/toolchain/symlinks/ld @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/ld \ No newline at end of file +../../../../../../llvm.org/v*/bin/lld \ No newline at end of file diff --git a/share/toolchain/symlinks/ld64.lld b/share/toolchain/symlinks/ld64.lld index e7be47ec..11c4841b 120000 --- a/share/toolchain/symlinks/ld64.lld +++ b/share/toolchain/symlinks/ld64.lld @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/ld64.lld \ No newline at end of file +../../../../../../llvm.org/v*/bin/ld64.lld \ No newline at end of file diff --git a/share/toolchain/symlinks/lld b/share/toolchain/symlinks/lld index d5bf90be..72b7a64d 120000 --- a/share/toolchain/symlinks/lld +++ b/share/toolchain/symlinks/lld @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/lld \ No newline at end of file +../../../../../../llvm.org/v*/bin/lld \ No newline at end of file diff --git a/share/toolchain/symlinks/lld-link b/share/toolchain/symlinks/lld-link index 9d31d258..e6a4cca3 120000 --- a/share/toolchain/symlinks/lld-link +++ b/share/toolchain/symlinks/lld-link @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/lld-link \ No newline at end of file +../../../../../../llvm.org/v*/bin/lld-link \ No newline at end of file diff --git a/share/toolchain/symlinks/nm b/share/toolchain/symlinks/nm index 3b20da51..b0a220ee 120000 --- a/share/toolchain/symlinks/nm +++ b/share/toolchain/symlinks/nm @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/nm \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-nm \ No newline at end of file diff --git a/share/toolchain/symlinks/objcopy b/share/toolchain/symlinks/objcopy index a2abc711..d2de81c0 120000 --- a/share/toolchain/symlinks/objcopy +++ b/share/toolchain/symlinks/objcopy @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/objcopy \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-objcopy \ No newline at end of file diff --git a/share/toolchain/symlinks/ranlib b/share/toolchain/symlinks/ranlib index 3befc1b9..e097d25a 120000 --- a/share/toolchain/symlinks/ranlib +++ b/share/toolchain/symlinks/ranlib @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/ranlib \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-ranlib \ No newline at end of file diff --git a/share/toolchain/symlinks/readelf b/share/toolchain/symlinks/readelf index e00765e6..34a0b971 120000 --- a/share/toolchain/symlinks/readelf +++ b/share/toolchain/symlinks/readelf @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/readelf \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-readelf \ No newline at end of file diff --git a/share/toolchain/symlinks/strings b/share/toolchain/symlinks/strings index fdc28ac0..4a69e6d8 120000 --- a/share/toolchain/symlinks/strings +++ b/share/toolchain/symlinks/strings @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/strings \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-strings \ No newline at end of file diff --git a/share/toolchain/symlinks/strip b/share/toolchain/symlinks/strip index d2949105..803b830c 120000 --- a/share/toolchain/symlinks/strip +++ b/share/toolchain/symlinks/strip @@ -1 +1 @@ -../../../../../llvm.org/v*/bin/strip \ No newline at end of file +../../../../../../llvm.org/v*/bin/llvm-strip \ No newline at end of file From c8b36707ee5bbcb8317a1cfaee0b6ae8cf1e4172 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 12:17:31 -0400 Subject: [PATCH 15/16] wip --- share/toolchain/shim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/toolchain/shim b/share/toolchain/shim index 80c24639..a2876044 100755 --- a/share/toolchain/shim +++ b/share/toolchain/shim @@ -2,10 +2,10 @@ tool=$(basename $0) -if [ $(uname) != Darwin ]; then - d="$(cd "$(basename "$0")" && pwd)" +# if [ $(uname) != Darwin ]; then + d="$(cd "$(dirname "$0")/.." && pwd)" exec tea +llvm.org $d/symlinks/$tool "$@" -fi +# fi case $tool in cc|gcc|clang|c++|g++|clang++) From 415add8838e200e57b626c1bee5d5b80dd553cfc Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 29 Sep 2023 13:03:46 -0400 Subject: [PATCH 16/16] wip --- share/toolchain/shim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/toolchain/shim b/share/toolchain/shim index a2876044..13466e3f 100755 --- a/share/toolchain/shim +++ b/share/toolchain/shim @@ -2,10 +2,10 @@ tool=$(basename $0) -# if [ $(uname) != Darwin ]; then +if [ $(uname) != Darwin ]; then d="$(cd "$(dirname "$0")/.." && pwd)" - exec tea +llvm.org $d/symlinks/$tool "$@" -# fi + exec "$TEA_PREFIX/tea.xyz/v*/bin/tea" +llvm.org $d/symlinks/$tool "$@" +fi case $tool in cc|gcc|clang|c++|g++|clang++)