Message ID | 20200928195648.30256-3-ludo@gnu.org |
---|---|
State | Accepted |
Headers | show |
Series | Add '--with-toolchain' package transformation option | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
On Mon, Sep 28, 2020 at 09:56:46PM +0200, Ludovic Courtès wrote: > From: Ludovic Courtès <ludovic.courtes@inria.fr> > > * gnu/packages/llvm.scm (make-clang-toolchain)[arguments]: Create 'cc' > and 'c++' symlinks. > --- > gnu/packages/llvm.scm | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm > index 4b42c4921a..361b39710b 100644 > --- a/gnu/packages/llvm.scm > +++ b/gnu/packages/llvm.scm > @@ -476,6 +476,12 @@ code analysis tools.") > (((names . directories) ...) > (union-build out directories))) > > + ;; Create 'cc' and 'c++' so that one can use it as a > + ;; drop-in replacement for the default tool chain and > + ;; have configure scripts find the compiler. > + (symlink "clang" (string-append out "/bin/cc")) > + (symlink "clang++" (string-append out "/bin/c++")) > + > (union-build (assoc-ref %outputs "debug") > (list (assoc-ref %build-inputs > "libc-debug"))) > -- > 2.28.0 Isn't this something we've turned down patches for in the past with gcc?
Hi Efraim, Efraim Flashner <efraim@flashner.co.il> skribis: > On Mon, Sep 28, 2020 at 09:56:46PM +0200, Ludovic Courtès wrote: >> From: Ludovic Courtès <ludovic.courtes@inria.fr> >> >> * gnu/packages/llvm.scm (make-clang-toolchain)[arguments]: Create 'cc' >> and 'c++' symlinks. >> --- >> gnu/packages/llvm.scm | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm >> index 4b42c4921a..361b39710b 100644 >> --- a/gnu/packages/llvm.scm >> +++ b/gnu/packages/llvm.scm >> @@ -476,6 +476,12 @@ code analysis tools.") >> (((names . directories) ...) >> (union-build out directories))) >> >> + ;; Create 'cc' and 'c++' so that one can use it as a >> + ;; drop-in replacement for the default tool chain and >> + ;; have configure scripts find the compiler. >> + (symlink "clang" (string-append out "/bin/cc")) >> + (symlink "clang++" (string-append out "/bin/c++")) >> + >> (union-build (assoc-ref %outputs "debug") >> (list (assoc-ref %build-inputs >> "libc-debug"))) >> -- >> 2.28.0 > > Isn't this something we've turned down patches for in the past with gcc? That is true, and, ahem, I even know a person who was against it. But! I think it’s a bit different here: (1) we’re only changing ‘clang-toolchain’, not ‘clang’, (2) while most build systems look for ‘gcc’ in addition to ‘cc’, few of them look for ‘clang’. ‘--with-toolchain’ is useful even if ‘clang-toolchain’ cannot be dropped in (it allows you to try out different GCC versions, for instance), but I think it’s more useful if one can use it to build their code with a different free tool chain. One use case that comes to mind is portability testing for C/C++ developers. WDYT? Thanks, Ludo’.
On Tue, Sep 29, 2020 at 09:53:18AM +0200, Ludovic Courtès wrote: > Hi Efraim, > > Efraim Flashner <efraim@flashner.co.il> skribis: > > > On Mon, Sep 28, 2020 at 09:56:46PM +0200, Ludovic Courtès wrote: > >> From: Ludovic Courtès <ludovic.courtes@inria.fr> > >> > >> * gnu/packages/llvm.scm (make-clang-toolchain)[arguments]: Create 'cc' > >> and 'c++' symlinks. > >> --- > >> gnu/packages/llvm.scm | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm > >> index 4b42c4921a..361b39710b 100644 > >> --- a/gnu/packages/llvm.scm > >> +++ b/gnu/packages/llvm.scm > >> @@ -476,6 +476,12 @@ code analysis tools.") > >> (((names . directories) ...) > >> (union-build out directories))) > >> > >> + ;; Create 'cc' and 'c++' so that one can use it as a > >> + ;; drop-in replacement for the default tool chain and > >> + ;; have configure scripts find the compiler. > >> + (symlink "clang" (string-append out "/bin/cc")) > >> + (symlink "clang++" (string-append out "/bin/c++")) > >> + > >> (union-build (assoc-ref %outputs "debug") > >> (list (assoc-ref %build-inputs > >> "libc-debug"))) > >> -- > >> 2.28.0 > > > > Isn't this something we've turned down patches for in the past with gcc? > > That is true, and, ahem, I even know a person who was against it. > > But! I think it’s a bit different here: (1) we’re only changing > ‘clang-toolchain’, not ‘clang’, (2) while most build systems look for > ‘gcc’ in addition to ‘cc’, few of them look for ‘clang’. > > ‘--with-toolchain’ is useful even if ‘clang-toolchain’ cannot be dropped > in (it allows you to try out different GCC versions, for instance), but > I think it’s more useful if one can use it to build their code with a > different free tool chain. One use case that comes to mind is > portability testing for C/C++ developers. > > WDYT? Do we want to have gcc-toolchain provide a cc binary then too? It seems like it would also help people who have a project they want to build by hand which has the compiler set as cc and they install the gcc-toolchain. > > Thanks, > Ludo’.
Hi, Efraim Flashner <efraim@flashner.co.il> skribis: > On Tue, Sep 29, 2020 at 09:53:18AM +0200, Ludovic Courtès wrote: [...] >> >> + ;; Create 'cc' and 'c++' so that one can use it as a >> >> + ;; drop-in replacement for the default tool chain and >> >> + ;; have configure scripts find the compiler. >> >> + (symlink "clang" (string-append out "/bin/cc")) >> >> + (symlink "clang++" (string-append out "/bin/c++")) >> >> + >> >> (union-build (assoc-ref %outputs "debug") >> >> (list (assoc-ref %build-inputs >> >> "libc-debug"))) >> >> -- >> >> 2.28.0 >> > >> > Isn't this something we've turned down patches for in the past with gcc? >> >> That is true, and, ahem, I even know a person who was against it. >> >> But! I think it’s a bit different here: (1) we’re only changing >> ‘clang-toolchain’, not ‘clang’, (2) while most build systems look for >> ‘gcc’ in addition to ‘cc’, few of them look for ‘clang’. >> >> ‘--with-toolchain’ is useful even if ‘clang-toolchain’ cannot be dropped >> in (it allows you to try out different GCC versions, for instance), but >> I think it’s more useful if one can use it to build their code with a >> different free tool chain. One use case that comes to mind is >> portability testing for C/C++ developers. >> >> WDYT? > > Do we want to have gcc-toolchain provide a cc binary then too? It seems > like it would also help people who have a project they want to build by > hand which has the compiler set as cc and they install the > gcc-toolchain. I’m not enthusiastic (I think it’s good that build systems and tools keep referring to ‘gcc’) but I guess I’ll have a more difficult time arguing against it now… Ludo’.
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 4b42c4921a..361b39710b 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -476,6 +476,12 @@ code analysis tools.") (((names . directories) ...) (union-build out directories))) + ;; Create 'cc' and 'c++' so that one can use it as a + ;; drop-in replacement for the default tool chain and + ;; have configure scripts find the compiler. + (symlink "clang" (string-append out "/bin/cc")) + (symlink "clang++" (string-append out "/bin/c++")) + (union-build (assoc-ref %outputs "debug") (list (assoc-ref %build-inputs "libc-debug")))
From: Ludovic Courtès <ludovic.courtes@inria.fr> * gnu/packages/llvm.scm (make-clang-toolchain)[arguments]: Create 'cc' and 'c++' symlinks. --- gnu/packages/llvm.scm | 6 ++++++ 1 file changed, 6 insertions(+)