| ... | @@ -195,10 +195,9 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module { | ... | @@ -195,10 +195,9 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module { |
| 195 | if (options.inherited.pic) |x| break :b x; | 195 | if (options.inherited.pic) |x| break :b x; |
| 196 | if (options.parent) |p| break :b p.pic; | 196 | if (options.parent) |p| break :b p.pic; |
| 197 | | 197 | |
| 198 | // Default to PIC on targets where we default to producing PIEs to make | 198 | // Default to PIC for objects and static libraries to make the common |
| 199 | // the common case of linking objects and static libraries into an | 199 | // cases of linking those into a PIE or a shared library just work. |
| 200 | // executable work out of the box. | 200 | break :b options.global.output_mode != .Exe; |
| 201 | break :b target_util.defaultPie(target); | | |
| 202 | }; | 201 | }; |
| 203 | | 202 | |
| 204 | const red_zone = b: { | 203 | const red_zone = b: { |