Commit Graph

17 Commits

Author SHA1 Message Date
Alastair Houghton
3c029ebd3f [IRGen] Use llvm.used on ELF instead of llvm.compiler.used.
We changed to `llvm.compiler.used` because of the behaviour of `gold`,
which refuses to coalesce sections that have different `SHF_GNU_RETAIN`
flags, which causes problems with metadata.

Originally I thought we were going to have to generate two sections
with distinct names and have the runtime look for both of them, but
it turns out that the runtime only wants to see sections that have
`SHF_GNU_RETAIN` in any case.  It's really the reflection code that
is interested in being able to see non-retained sections.  The upshot
is that we don't need to use `llvm.compiler.used`; it's just fine if
we have duplicate sections, as long as the reflection code looks for
them when it's inspecting an ELF image.

This also means we no longer need to pass `-z nostart-stop-gc` to the
linker if we're using `lld`.

rdar://123504095
2024-04-29 10:48:22 +01:00
Arnold Schwaighofer
3b5ebaa46c Fix some tests in IRGen folder 2023-06-21 10:10:32 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Arnold Schwaighofer
d45fd3c4ac IRGen: Adjust to new AddressSanitizer's way of marking globals to be ignored
rdar://102152139
2022-11-11 09:55:16 -08:00
Arnold Schwaighofer
b9de9a96ed Fix elf tests 2021-09-03 11:17:57 -07:00
Kuba (Brecka) Mracek
382f04ac79 Do not set alignment and don't set disableAddressSanitizer on @llvm.used and @llvm.compiler.used (#34970)
* Do not set alignment and don't set disableAddressSanitizer on @llvm.used and @llvm.compiler.used

* Update tests
2021-08-23 18:34:27 -07:00
Yuta Saito
6362a98aa0 [Frontend] Add -public-autolink-library option (#35936)
Foundation imports CoreFoundation with `@_implementationOnly`,
so CoreFoundation's modulemap won't be read, and the dependent libraries
of CoreFoundation will not be automatically linked when using static
linking.

For example, CoreFoundation depends on libicui18n and it's modulemap has
`link "icui18n"` statement. If Foundation imports CoreFoundation with
`@_implementationOnly` as a private dependency, the toolchain doesn't have
CoreFoundation's modulemap and Foundation's swiftmodule  doesn't import
CoreFoundation. So the swiftc can't know that libicui18n is required.

This new option will add LINK_LIBRARY entry in swiftmodule to
specify dependent libraries (in the example case, Foundation's
swiftmodule should have LINK_LIBRARY entry of libicui18n)


See also: [Autolinking behavior of @_implementationOnly with static linking](https://forums.swift.org/t/autolinking-behavior-of-implementationonly-with-static-linking/44393)
2021-06-15 12:38:19 +01:00
Slava Pestov
5680bfde55 IRGen: Always use YAML files for completely fragile class layout
The layouts of resilient value types shipped in the Swift 5 standard library
x and overlays will forever be frozen in time for backward deployment to old
Objective-C runtimes. This PR ensures that even if the layouts of these types
evolve in the future, binaries built to run on the old runtime will continue
to lay out class instances in a manner compatible with Swift 5.

Fixes <rdar://problem/45646886>.
2019-02-08 14:22:00 -05:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Dmitri Gribenko
57968544d5 Fix test/IRGen/autolink_elf.swift
Resolves SR-2116.
2016-07-27 12:50:01 -06:00
Michael Gottesman
e7ed09d88e Make sure a test that has never run on any platform continues to never run on any platforms. 2016-07-19 10:41:52 -07:00
David Farler
263af75590 Revert "Stamp Swift binaries with the reflection version"
This reverts commit 437d3f2043.
2016-04-15 12:26:27 -07:00
David Farler
437d3f2043 Stamp Swift binaries with the reflection version
This will be cross-checked with SwiftRemoteMirror's version
compatibility.

rdar://problem/25559468
2016-04-07 20:16:13 -07:00
Dmitri Hrybenko
ea7b133046 Update tests for new LLVM IR syntax for the gep operator
Swift SVN r26132
2015-03-14 07:17:15 +00:00
Dmitri Hrybenko
932e228ed2 IRGen: mark autolinking information on ELF as used
Swift SVN r25845
2015-03-08 03:49:54 +00:00