1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 00:57:08 +03:00
Commit Graph

3287 Commits

Author SHA1 Message Date
Rui Ueyama
2b818dbe44 Use strerror() instead of strerror_r()
This should fix the build on Android.
Fixes https://github.com/rui314/mold/issues/231
2022-01-02 23:40:51 +09:00
Rui Ueyama
19dce5342f Fix -Wc++11-narrowing
Fixes https://github.com/rui314/mold/issues/231
2022-01-02 22:47:23 +09:00
Rui Ueyama
5618038463 [ELF] Show a better error message for the empty input file
Fixes https://github.com/rui314/mold/issues/227
2022-01-02 19:33:07 +09:00
Rui Ueyama
9178b762fc Refactor 2022-01-02 15:44:52 +09:00
Rui Ueyama
fea59750ed Do not use LTO to build oneTBB as it causes link failure 2022-01-02 12:52:01 +09:00
Rui Ueyama
fba4cb9114 Merge commit 'b82badd127f38f4fea6a4f1c0ec22900dd9dd8e3' as 'third-party/tbb' 2022-01-02 12:51:35 +09:00
Rui Ueyama
b82badd127 Squashed 'third-party/tbb/' content from commit 3df08fe23
git-subtree-dir: third-party/tbb
git-subtree-split: 3df08fe234f23e732a122809b40eb129ae22733f
2022-01-02 12:51:35 +09:00
Rui Ueyama
d3dc8a2377 Temporarily remove oneTBB to upgrade to v2021.5.0 2022-01-02 12:51:29 +09:00
Rui Ueyama
df24372775
Merge pull request #220 from rmcgibbo/main
[ELF] Fix parsing of --no-dynamic-linker on command line
2022-01-02 11:54:27 +09:00
Rui Ueyama
0a8231b59d [ELF] Support R_X86_64_GOTOFF64
Fixes https://github.com/rui314/mold/issues/224
2022-01-02 11:14:33 +09:00
Rui Ueyama
1f7727975c [ELF] Improve test 2022-01-02 11:13:12 +09:00
Robert T. McGibbon
68fa44d399 [ELF] Fix parsing of --no-dynamic-linker on command line
Signed-off-by: Robert T. McGibbon <rmcgibbo@gmail.com>
2022-01-01 12:22:48 -05:00
Rui Ueyama
ab83ed8691
Merge pull request #221 from sicherha/deduplicate-quick-exit
Remove duplicate code
2022-01-01 19:51:32 +09:00
Christoph Erhardt
ebe982c443 Remove duplicate code
The exact same four lines of code exist a few lines below this hunk.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
2022-01-01 09:44:37 +01:00
Rui Ueyama
4ccbd24c60
Merge pull request #219 from sicherha/libcxx-13-compatibility
Compatibility for libc++ < 14, plus two additional fixes
2022-01-01 09:12:00 +09:00
Christoph Erhardt
da0d0a7b52 Improve workaround for libc++ < 14
The underlying issue got fixed in libc++ 14 with
https://reviews.llvm.org/D97084, but Xcode 13.1 still ships libc++ 13.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-31 16:09:26 +01:00
Christoph Erhardt
a537509aa6 Fix errno_string() returning an empty string on GNU
Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-31 16:09:26 +01:00
Christoph Erhardt
865b6fed89 Terminate argv array with nullptr
This fixes an error where the subsequent `execv()` occasionally fails
with 'Bad address'.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-31 15:43:22 +01:00
Rui Ueyama
d100a735a0 Refactor: rename a function 2021-12-31 21:28:16 +09:00
Rui Ueyama
902f23c456 Refactor 2021-12-31 21:04:07 +09:00
Rui Ueyama
c92e192e56 [ELF] Remove redundant inline keywords 2021-12-31 21:02:06 +09:00
Rui Ueyama
440ff27e58 [ELF] Refactor 2021-12-31 21:01:59 +09:00
Rui Ueyama
085e3c3abe Simplify 2021-12-31 18:04:39 +09:00
Rui Ueyama
58e43633fc Revert "Revert "Use C++17 filesystem API""
This reverts commit f29a85f20a with a fix
for a build failure.
2021-12-31 16:39:54 +09:00
Rui Ueyama
d743acb6cd Disable mimalloc on Android host 2021-12-31 16:14:15 +09:00
Rui Ueyama
cb2b4b8f72 Bump mold version to 1.0.1 2021-12-31 14:10:03 +09:00
Rui Ueyama
f0874f187a
Merge pull request #214 from tklauser/macho-fatal-no-input-files
[Mach-O] Fatal if no input files are given
2021-12-31 10:45:24 +09:00
Tobias Klauser
c029521b24
[Mach-O] Fatal if no input files are given
Follow the same behavior in the ELF version of read_input_files and
fatal in case no input files are given. This avoids a segfault in
successive functions when running `./ld64.mold` without any arguments.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-12-30 23:26:28 +01:00
Rui Ueyama
7a8beac1c2 [Mach-O] Remove homebrew paths from -L and -I flags
I added homebrew's library paths to -L and -I flags for libxxhash.
Now mold includes libxxhash as a subdirectory, we don't need it.
2021-12-31 00:45:58 +09:00
Rui Ueyama
b5172caeb5 Improve test
I think `-m32` means ARM32 if this test runs on ARM64.
2021-12-31 00:13:07 +09:00
Rui Ueyama
baff2948d4
Merge pull request #213 from tklauser/test-fix-i386-mergable-strings
Fix skip check in i386-mergable-strings.sh
2021-12-31 00:07:04 +09:00
Tobias Klauser
66c9659f5a
Fix skip check in i386-mergable-strings.sh
Check for the ability to build 32-bit binaries like in the other i386
test cases.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-12-30 15:58:11 +01:00
Rui Ueyama
9697febd83
Merge pull request #212 from tklauser/macos-x86_64
Avoid infinite recursion in do_main<X86_64>
2021-12-30 22:18:58 +09:00
Rui Ueyama
f29a85f20a Revert "Use C++17 filesystem API"
This reverts commit f6e91df440 because
it causes build breakages for a lot of Gentoo packages.
2021-12-30 22:15:52 +09:00
Tobias Klauser
cc9f6f430b
Avoid infinite recursion in do_main<X86_64>
Running mold on x86_64 macOS 11 currently leads to a segfault due to
inifinite recursion in do_main<X86_64>. Protect against this case by
only calling into do_main<X86_64> once if cputype doesn't match.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2021-12-30 14:08:16 +01:00
Rui Ueyama
7776165ef7 Fix macOS build 2021-12-30 21:40:42 +09:00
Rui Ueyama
f6e91df440 Use C++17 filesystem API 2021-12-30 21:32:01 +09:00
Rui Ueyama
3f6e889449 Do not use exceptions
If a given path does not exist, std::filesystem::canonical throws an
exception unless `ec` is given.
2021-12-30 20:33:26 +09:00
Rui Ueyama
8d838e4fd1
Merge pull request #210 from sicherha/path-buffer-sizes
Fix handling of path buffer sizes
2021-12-30 16:51:02 +09:00
Christoph Erhardt
68c4b76352 Use std::filesystem to circumvent buffer-size issues
Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-30 08:43:36 +01:00
Rui Ueyama
f6e800655b [ELF] Add a description for --defsym to the man page 2021-12-30 15:44:08 +09:00
Rui Ueyama
35ca107361 Add a missing header 2021-12-30 15:10:07 +09:00
Rui Ueyama
3f8f2e89e5 Show "Passed all tests" message in green 2021-12-30 15:05:17 +09:00
Rui Ueyama
d49c50ddaf [ELF] Add --defsym
Fixes https://github.com/rui314/mold/issues/208
2021-12-30 14:48:39 +09:00
Rui Ueyama
44ae92c4ed Remove redundant "../../" from test script paths
So that it's easier to see the output of the test script running
with `bash -x` . This change was made using sed.
2021-12-30 11:11:27 +09:00
Rui Ueyama
ec628cb0bf
Merge pull request #209 from sicherha/fix-shellcheck-warnings
Add lots of quotes to shell scripts
2021-12-30 07:04:09 +09:00
Christoph Erhardt
0dcc910223 Add lots of quotes to shell scripts
This makes it possible to build and test mold in a path that contains
whitespace characters - with the notable exception of the tests where
`LD_PRELOAD` is used. That's because `LD_PRELOAD` unconditionally treats
any whitespace as separator, regardless of quoting.

The following ShellCheck warnings are eliminated by this commit:
* SC2046: Quote this to prevent word splitting.
* SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
2021-12-29 22:18:19 +01:00
Rui Ueyama
1c6c8c3479 Update README 2021-12-29 21:36:06 +09:00
Rui Ueyama
99866f01b2 Update README as GCC 12.1.0 or later accepts -fuse-ld=mold
Fixes https://github.com/rui314/mold/issues/205
2021-12-29 21:21:45 +09:00
Rui Ueyama
f3766cda81 [ELF] Add -z {max,common}-page-size
Fixes https://github.com/rui314/mold/issues/203
2021-12-29 17:14:08 +09:00