From eb14fd8806885b43dd98492f0a6720038d8176c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 5 Nov 2024 15:25:43 +0100 Subject: [PATCH] libcxx: Pass -fPIC via module options instead of CFLAGS. --- src/libcxx.zig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libcxx.zig b/src/libcxx.zig index a9f3030c42..ec89ac1cfc 100644 --- a/src/libcxx.zig +++ b/src/libcxx.zig @@ -195,7 +195,7 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError! .valgrind = false, .optimize_mode = optimize_mode, .structured_cfg = comp.root_mod.structured_cfg, - .pic = comp.root_mod.pic, + .pic = if (target_util.supports_fpic(target)) true else null, }, .global = config, .cc_argv = &.{}, @@ -278,9 +278,6 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError! try cflags.append("-faligned-allocation"); } - if (target_util.supports_fpic(target)) { - try cflags.append("-fPIC"); - } try cflags.append("-nostdinc++"); try cflags.append("-std=c++23"); try cflags.append("-Wno-user-defined-literals");