| Age | Commit message (Collapse) | Author |
|
* move `ptrBitWidth` from Arch to Target since it needs to know about the abi
* double isn't always 8 bits
* AVR uses 1-byte alignment for everything in GCC
|
|
|
|
|
|
|
|
|
|
|
|
Also clean up parsing of linker args - reuse `ArgsIterator`.
In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.
MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
|
|
In addition, we need to be careful not to mark the relocations as
resolved prematurely as then we are risking malforming the binary
as we need to resolve the relocs twice: once for in-memory writes,
and once for in-file updates.
|
|
|
|
|
|
coff: improve handling of relocs and general linker fixes
|
|
|
|
Allow dynamicbase to be disabled by CompileStep
|
|
|
|
|
|
|
|
Instead, introduce a custom ImportTable structure which will
act as a thunk in the MachO linker, and we will use that to
calculate the address of a pointer on-the-fly.
Additionally, fix logic in writeImportTables to allow for multiple
DLLs.
|
|
pass the negation to lld, and add --no-dynamicbase
build: expose linker_dynamicbase on CompileStep and map it to emit --no-dynamicbase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cc on Windows-Clang
|
|
Using zig cc with CMake on Windows was failing during compiler
detection. -nostdinc was causing the crt not to be linked, and Coff/lld.zig
assumed that wWinMainCRTStartup would be present in this case.
-nostdlib did not prevent the default behaviour of linking libc++ when
zig c++ was used. This caused libc++ to be built when CMake ran
ABI detection using zig c++, which fails as libcxxabi cannot compile
under MSVC.
- Change the behaviour of COFF -nostdinc to set /entry to the function that the
default CRT method for the specified subsystem would have called.
- Fix -ENTRY being passed twice if it was specified explicitly and -nostdlib was present.
- Add support for /pdb, /version, /implib, and /subsystem as linker args (passed by CMake)
- Remove -Ddisable-zstd, no longer needed
- Add -Ddisable-libcpp for use when bootstrapping on msvc
|
|
|
|
|
|
- add support for passing through .def files to the linker,
required for building libLTO.dll in LLVM
- fixup libcpp linking conditionals
- add option to skip linking zstd for use in bootstrapping (when
building against an LLVM with LLVM_ENABLE_ZSTD=OFF)
|
|
|
|
|
|
After this commit, the self-hosted compiler does not offer the option to
use stage1 as a backend anymore.
|
|
Closes #7484. Right now for UEFI targets an alignment
of 32 is being used for no reason other than support
a rare bytecode. As this is far from the standard case,
removing this alignment and using the default one,
as most toolchains do, should be the desired behavior.
|
|
There was no check for linker errors after flushing,
which meant that if the link failed the build would
continue and try to copy the non-existant exe, and
also write the manifest as if it had succeeded.
Also adds parsing of lld output, which is surfaced at the
end of the compilation with the other errors instead
of via stderr
|
|
|
|
|
|
On Windows, lld-link resolves PDB output paths using `/` and embeds the
result in the final executable, which breaks some native tooling like
WPR/WPA. This commit overrides the default behavior of lld-link by
explicitly setting the output PDB filename and binary-embedded path.
|
|
|
|
|
|
|
|
|
|
|
|
This means we can request ASLR on by default as other COFF linkers
do. Currently, we write the base relocations in bulk, however,
given that there is a mechanism for padding in place in PE/COFF
I believe there might be room for making it an incremental operation
(write base relocation whenever we add/update a pointer that would
require it).
|
|
Given that COFF will want to support PIC from ground-up, there is no
point in leaving outdated code for COFF in other backends such as
arm or aarch64. Instead, when we are ready to look into those, we
can start figuring out what to add and where.
|
|
|
|
|
|
|
|
|