Skip to content

Commit eb14fd8

Browse files
committed
libcxx: Pass -fPIC via module options instead of CFLAGS.
1 parent 796d484 commit eb14fd8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/libcxx.zig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
195195
.valgrind = false,
196196
.optimize_mode = optimize_mode,
197197
.structured_cfg = comp.root_mod.structured_cfg,
198-
.pic = comp.root_mod.pic,
198+
.pic = if (target_util.supports_fpic(target)) true else null,
199199
},
200200
.global = config,
201201
.cc_argv = &.{},
@@ -278,9 +278,6 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
278278
try cflags.append("-faligned-allocation");
279279
}
280280

281-
if (target_util.supports_fpic(target)) {
282-
try cflags.append("-fPIC");
283-
}
284281
try cflags.append("-nostdinc++");
285282
try cflags.append("-std=c++23");
286283
try cflags.append("-Wno-user-defined-literals");

0 commit comments

Comments
 (0)