485094fdf70b — Leonard Ritter 22 days ago
* compiler.clang recipe: use `ld.lld` instead of `lld` so clang can use its own linker properly
* fixed license accidentally removing copyright notice on the last update.
3 files changed, 11 insertions(+), 5 deletions(-)

M LICENSE.md
M external/recipes/clang.eo
M lib/scopes/compiler/build.sc
M LICENSE.md +2 -2
@@ 1,5 1,5 @@ 
-<project name>
-Copyright (C) <year> <author>
+The Scopes Programming Infrastructure
+Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Leonard Ritter.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), regardless of their gender, ethnicity or political affiliation, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 

          
M external/recipes/clang.eo +1 -1
@@ 25,7 25,7 @@ package clang
     libdir := "{rootdir}/lib"
     destbasedir := "/lib/scopes/compiler/clang"
     in "{destbasedir}/bin"
-        "{bindir}/lld"
+        "{bindir}/ld.lld"
         "{bindir}/clang"
     in "{destbasedir}/include"
         "{includedir}/clang-c"

          
M lib/scopes/compiler/build.sc +8 -2
@@ 7,7 7,7 @@ unlet exit
 using import print slice Buffer format
 #using import C.stdlib C.stat C.limits C.stdio C.string C.unistd C.dlfcn
 using import C.stdio C.unistd C.limits C.string C.stdlib C.stat
-using import compiler.header compiler.pathutils
+using import compiler.header compiler.pathutils compiler.config
 
 using import String #.target.UVM
 

          
@@ 15,6 15,9 @@ windows? := operating-system == 'windows
 
 run-stage;
 
+#COMPILER := .. CLANG_BASE_DIR "/bin/clang"
+COMPILER := "gcc"
+
 #CLANG_BASE_DIR := .. module-dir "/clang"
 #SPIRV_TOOLS_BASE_DIR := .. module-dir "/target/SPIR-V"
 #SPIRV_CROSS_BASE_DIR := SPIRV_TOOLS_BASE_DIR

          
@@ 183,6 186,9 @@ fn compile-linux ()
                 else
                     String "tmp.so"
         local opts : String
+        ## use lld and disable LTO
+        #'append opts
+            " -fuse-ld=lld -Wl,--lto-CGO0 -Wl,--lto-O0"
         if (emit == "shared")
             'append opts " -shared"
             'append opts " -fPIC"

          
@@ 209,7 215,7 @@ fn compile-linux ()
                     lib := lib as string
                     'append opts " -l:"
                     'append opts lib
-        cmd := String "gcc" opts
+        cmd := String COMPILER opts
         if verbose?
             print2 cmd
         code := system cmd