@@ -129,6 +129,8 @@ pub fn buildLibCXX(comp: *Compilation) !void {
129
129
try cflags .append ("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS" );
130
130
try cflags .append ("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS" );
131
131
try cflags .append ("-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS" );
132
+ try cflags .append ("-fvisibility=hidden" );
133
+ try cflags .append ("-fvisibility-inlines-hidden" );
132
134
133
135
if (target .abi .isMusl ()) {
134
136
try cflags .append ("-D_LIBCPP_HAS_MUSL_LIBC" );
@@ -144,7 +146,6 @@ pub fn buildLibCXX(comp: *Compilation) !void {
144
146
try cflags .append ("-fPIC" );
145
147
}
146
148
try cflags .append ("-nostdinc++" );
147
- try cflags .append ("-fvisibility-inlines-hidden" );
148
149
try cflags .append ("-std=c++14" );
149
150
try cflags .append ("-Wno-user-defined-literals" );
150
151
@@ -174,6 +175,8 @@ pub fn buildLibCXX(comp: *Compilation) !void {
174
175
.want_tsan = comp .bin_file .options .tsan ,
175
176
.want_pic = comp .bin_file .options .pic ,
176
177
.want_pie = comp .bin_file .options .pie ,
178
+ .want_lto = comp .bin_file .options .lto ,
179
+ .function_sections = comp .bin_file .options .function_sections ,
177
180
.emit_h = null ,
178
181
.strip = comp .compilerRtStrip (),
179
182
.is_native_os = comp .bin_file .options .is_native_os ,
@@ -247,6 +250,8 @@ pub fn buildLibCXXABI(comp: *Compilation) !void {
247
250
try cflags .append ("-D_LIBCXXABI_BUILDING_LIBRARY" );
248
251
try cflags .append ("-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS" );
249
252
try cflags .append ("-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS" );
253
+ try cflags .append ("-fvisibility=hidden" );
254
+ try cflags .append ("-fvisibility-inlines-hidden" );
250
255
251
256
if (target .abi .isMusl ()) {
252
257
try cflags .append ("-D_LIBCPP_HAS_MUSL_LIBC" );
@@ -292,6 +297,8 @@ pub fn buildLibCXXABI(comp: *Compilation) !void {
292
297
.want_tsan = comp .bin_file .options .tsan ,
293
298
.want_pic = comp .bin_file .options .pic ,
294
299
.want_pie = comp .bin_file .options .pie ,
300
+ .want_lto = comp .bin_file .options .lto ,
301
+ .function_sections = comp .bin_file .options .function_sections ,
295
302
.emit_h = null ,
296
303
.strip = comp .compilerRtStrip (),
297
304
.is_native_os = comp .bin_file .options .is_native_os ,
0 commit comments