-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile when using tcc >0.9.27 (#238)
This allows ksh to be compiled with versions of tcc that define __dso_handle in libtcc1.a, i.e., versions as of this commit: https://repo.or.cz/tinycc.git/commit/dd60b20c Older versions of tcc still fail to compile ksh, although now they fail after reaching the libdll feature test. I'm not sure if fixing that is feasible since even if I hack out the failing libdll feature test, ksh fails to link with a '__dso_handle' error. src/lib/libast/comp/atexit.c, src/lib/libast/features/lib, src/lib/libast/vmalloc/vmexit.c: - From what I've been able to gather the only OSes with support for on_exit are Linux and SunOS 4. However, on_exit takes two arguments, so the macro that defines it as taking one argument is incorrect. Since Solaris (SunOS 5) no longer has this call and the macro breaks on Linux, the clean fix is to remove it (atexit(3) is used instead). src/lib/libast/include/ast.h: - When compiling with tcc on FreeBSD, pretend to be gcc 2.95.3 instead of gcc 9.3.0. This stops /usr/include/math.h from activating gcc 3.0+ math compiler builtins that don't exist on tcc, while still identifying as gcc which is needed to avoid other FreeBSD system header breakage. src/cmd/builtin/Mamfile, src/cmd/builtin/features/pty, src/lib/libdll/Mamfile, src/lib/libdll/features/dll: - tcc forbids combining the -c compiler flag with -l* linker flags. Use the -lm flag in the iffe feature tests instead of the Mamfiles. This avoids iffe combining -lm with the -c flag. src/lib/libast/vmalloc/malloc.c: - Fix failure to compile with -D_std_malloc. This patch is from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-malloc-hook.dif As it turns out tcc needs this change to build ksh with -D_std_malloc, so it has been applied. Co-authored-by: Martijn Dekker <[email protected]> Resolves: #232
- Loading branch information
Showing
9 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters