Different linker support #197
-
I personally use mold as my default linker on my Debian machine. Since GCC 12 the flag Is there a way to append |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, use the following in your Nelua code: ## ldflags '-fuse-ld=mold' Although using ## cflags '-fuse-ld=mold' Technically it's more correct to use This can also be set via command line, just like
Yes, creating a return {
cflags='-pipe', -- pipe option may speedup GCC compilation by creating less temporary files
ldflags='-fuse-ld=mold', -- mold linker may speedup GCC linking
}
What makes mold appealing is that it is able to link hundreds of object files very fast taking full use of processor cores. Though Nelua usually compiles everything into a single object file, and that is less parallelizable. I am not aware of mold internals, but I would expect to make less difference in this case. There is also another linker I use sometimes to link faster, the |
Beta Was this translation helpful? Give feedback.
Yes, use the following in your Nelua code:
Although using
cflags
will also work:Technically it's more correct to use
ldflags
, since this is a linkage flag. The main difference between usingldflags
instead ofcflags
, is thatldflags
options won't be used when Nelua attempts to compile object files and static libraries.This can also be set via command line, just like
--cflags
, you can also use--ldflags
.Yes, creating a
~/.config/nelua/neluacfg.lua
like the following: