Commit: ddea26dba14e1234c9c3116b4073e773147c2d60
Parent: 2f4e64cd20d2afcb26294dac84a6a745d0aa2adf
Author: Randy Palamar
Date: Fri, 11 Oct 2024 06:21:48 -0600
u-config: use -nostdlib instead of -nostartfiles and simplify exe() call
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pkg/devel/u-config/gen.lua b/pkg/devel/u-config/gen.lua
@@ -8,17 +8,17 @@ local archcflags = {}
local archldflags = {}
archcflags['generic'] = {}
archldflags['generic'] = {}
-archcflags['x86_64'] = {'-fno-stack-protector', '-ffreestanding', '-fno-builtin'}
-archldflags['x86_64'] = {'-nostartfiles'}
+archcflags['x86_64'] = {'-fno-asynchronous-unwind-tables', '-fno-stack-protector', '-fno-builtin'}
+archldflags['x86_64'] = {'-nostdlib', '-Wl,--gc-sections'}
-local archexe = {}
-archexe['generic'] = function() exe('u-config', {'generic_main.c'}) end
-archexe['x86_64'] = function() exe('u-config', {'linux_amd64_main.c'}) end
+local archsrcs = {}
+archsrcs['generic'] = {'generic_main.c'}
+archsrcs['x86_64'] = {'linux_amd64_main.c'}
cflags(archcflags[arch])
set('ldflags', '$ldflags '..table.concat(archldflags[arch], ' '))
-archexe[arch]()
+exe('u-config', archsrcs[arch])
file('bin/u-config', '755', '$outdir/u-config')
sym('bin/pkg-config', 'u-config')
man({'u-config.1'})