···11-From fac083e7ac8a37b61a4082bbbca2848e52fd1bb2 Mon Sep 17 00:00:00 2001
22-From: Ben Gamari <ben@smart-cactus.org>
33-Date: Sun, 9 Aug 2020 09:15:16 -0400
44-Subject: [PATCH] Revert "[linker/rtsSymbols] More linker symbols"
55-66-This reverts commit aa2e5863699306920513b216f337de09e29b5bb8.
77----
88- rts/RtsSymbols.c | 224 ++++-------------------------------------------
99- 1 file changed, 17 insertions(+), 207 deletions(-)
1010-1111-diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
1212-index d10a6900db..b2f90a892d 100644
1313---- a/rts/RtsSymbols.c
1414-+++ b/rts/RtsSymbols.c
1515-@@ -58,6 +58,7 @@
1616- SymI_HasProto(signal_handlers) \
1717- SymI_HasProto(stg_sig_install) \
1818- SymI_HasProto(rtsTimerSignal) \
1919-+ SymI_HasProto(atexit) \
2020- SymI_NeedsDataProto(nocldstop)
2121- #endif
2222-2323-@@ -976,213 +977,29 @@
2424- RTS_USER_SIGNALS_SYMBOLS \
2525- RTS_INTCHAR_SYMBOLS
2626-2727-+
2828- // 64-bit support functions in libgcc.a
2929--// See https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc
3030--#define RTS_LIBGCC_SYMBOLS_32 \
3131-- SymI_NeedsProto(__fixunsdfdi) \
3232-- /* 4 The GCC low-level runtime library */\
3333-- /* 4.1.1 Arithmetic functions */\
3434-- /* SymI_NeedsProto(__ashlsi3) */\
3535-- SymI_NeedsProto(__ashldi3) \
3636-- /* SymI_NeedsProto(__ashlti3) */\
3737-- /* These functions return the result of shifting a left by b bits. */\
3838-- /* SymI_NeedsProto(__ashrsi3) */\
3939-- SymI_NeedsProto(__ashrdi3) \
4040-- /* SymI_NeedsProto(__ashrti3) */\
4141-- /* These functions return the result of arithmetically shifting a right by b bits. */\
4242-- /* SymI_NeedsProto(__divsi3) */\
4343-- SymI_NeedsProto(__divdi3) \
4444-- /* SymI_NeedsProto(__divti3) */\
4545-- /* These functions return the quotient of the signed division of a and b. */\
4646-- /* SymI_NeedsProto(__lshrsi3) */ \
4747-- SymI_NeedsProto(__lshrdi3) \
4848-- /* SymI_NeedsProto(__lshrti3) */ \
4949-- /* These functions return the result of logically shifting a right by b bits. */\
5050-- /* SymI_NeedsProto(__modsi3) */ \
5151-- SymI_NeedsProto(__moddi3) \
5252-- /* SymI_NeedsProto(__modti3) */ \
5353-- /* These functions return the remainder of the signed division of a and b. */\
5454-- /* SymI_NeedsProto(__mulsi3) */ \
5555-- SymI_NeedsProto(__muldi3) \
5656-- /* SymI_NeedsProto(__multi3) */ \
5757-- /* These functions return the product of a and b. */\
5858-- SymI_NeedsProto(__negdi2) \
5959-- /* SymI_NeedsProto(__negti2) */ \
6060-- /* These functions return the negation of a. */\
6161-- /* SymI_NeedsProto(__udivsi3) */ \
6262-- SymI_NeedsProto(__udivdi3) \
6363-- /* SymI_NeedsProto(__udivti3) */ \
6464-- /* These functions return the quotient of the unsigned division of a and b. */\
6565-- SymI_NeedsProto(__udivmoddi4) \
6666-- /* SymI_NeedsProto(__udivmodti4) */ \
6767-- /* These functions calculate both the quotient and remainder of the unsigned division of a and b. The return value is the quotient, and the remainder is placed in variable pointed to by c. */\
6868-- /* SymI_NeedsProto(__umodsi3) */ \
6969-- SymI_NeedsProto(__umoddi3) \
7070-- /* SymI_NeedsProto(__umodti3) */ \
7171-- /* These functions return the remainder of the unsigned division of a and b. */\
7272-- /* 4.1.2 Comparison functions */\
7373-- /* The following functions implement integral comparisons. These functions implement a low-level compare, upon which the higher level comparison operators (such as less than and greater than or equal to) can be constructed. The returned values lie in the range zero to two, to allow the high-level operators to be implemented by testing the returned result using either signed or unsigned comparison. */\
7474-- SymI_NeedsProto(__cmpdi2) \
7575-- /* SymI_NeedsProto(__cmpti2) */ \
7676-- /* These functions perform a signed comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
7777-- SymI_NeedsProto(__ucmpdi2) \
7878-- /* SymI_NeedsProto(__ucmpti2) */ \
7979-- /* These functions perform an unsigned comparison of a and b. If a is less than b, they return 0; if a is greater than b, they return 2; and if a and b are equal they return 1. */\
8080-- /* 4.1.3 Trapping arithmetic functions */\
8181-- /* The following functions implement trapping arithmetic. These functions call the libc function abort upon signed arithmetic overflow. */\
8282-- SymI_NeedsProto(__absvsi2) \
8383-- SymI_NeedsProto(__absvdi2) \
8484-- /* These functions return the absolute value of a. */\
8585-- /* SymI_NeedsProto(__addvsi3) */ \
8686-- SymI_NeedsProto(__addvdi3) \
8787-- /* These functions return the sum of a and b; that is a + b. */\
8888-- /* SymI_NeedsProto(__mulvsi3) */ \
8989-- SymI_NeedsProto(__mulvdi3) \
9090-- /* The functions return the product of a and b; that is a * b. */\
9191-- SymI_NeedsProto(__negvsi2) \
9292-- SymI_NeedsProto(__negvdi2) \
9393-- /* These functions return the negation of a; that is -a. */\
9494-- /* SymI_NeedsProto(__subvsi3) */ \
9595-- SymI_NeedsProto(__subvdi3) \
9696-- /* These functions return the difference between b and a; that is a - b. */\
9797-- /* 4.1.4 Bit operations */\
9898-- SymI_NeedsProto(__clzsi2) \
9999-- SymI_NeedsProto(__clzdi2) \
100100-- /* SymI_NeedsProto(__clzti2) */ \
101101-- /* These functions return the number of leading 0-bits in a, starting at the most significant bit position. If a is zero, the result is undefined. */\
102102-- SymI_NeedsProto(__ctzsi2) \
103103-- SymI_NeedsProto(__ctzdi2) \
104104-- /* SymI_NeedsProto(__ctzti2) */ \
105105-- /* These functions return the number of trailing 0-bits in a, starting at the least significant bit position. If a is zero, the result is undefined. */\
106106-- SymI_NeedsProto(__ffsdi2) \
107107-- /* SymI_NeedsProto(__ffsti2) */ \
108108-- /* These functions return the index of the least significant 1-bit in a, or the value zero if a is zero. The least significant bit is index one. */\
109109-- SymI_NeedsProto(__paritysi2) \
110110-- SymI_NeedsProto(__paritydi2) \
111111-- /* SymI_NeedsProto(__parityti2) */\
112112-- /* These functions return the value zero if the number of bits set in a is even, and the value one otherwise. */\
113113-- SymI_NeedsProto(__popcountsi2) \
114114-- SymI_NeedsProto(__popcountdi2) \
115115-- /* SymI_NeedsProto(__popcountti2) */ \
116116-- /* These functions return the number of bits set in a. */\
117117-- SymI_NeedsProto(__bswapsi2) \
118118-- SymI_NeedsProto(__bswapdi2)
119119--#define RTS_LIBGCC_SYMBOLS_aarch32 \
120120-- /* armv6l */\
121121-- /* TODO: should check for __ARM_EABI__ */\
122122-- SymI_NeedsProto(__aeabi_d2f) \
123123-- SymI_NeedsProto(__aeabi_d2iz) \
124124-- SymI_NeedsProto(__aeabi_d2lz) \
125125-- SymI_NeedsProto(__aeabi_d2uiz) \
126126-- SymI_NeedsProto(__aeabi_d2ulz) \
127127-- SymI_NeedsProto(__aeabi_dadd) \
128128-- SymI_NeedsProto(__aeabi_dcmpeq) \
129129-- SymI_NeedsProto(__aeabi_dcmpge) \
130130-- SymI_NeedsProto(__aeabi_dcmpgt) \
131131-- SymI_NeedsProto(__aeabi_dcmple) \
132132-- SymI_NeedsProto(__aeabi_dcmplt) \
133133-- SymI_NeedsProto(__aeabi_dcmpun) \
134134-- SymI_NeedsProto(__aeabi_ddiv) \
135135-- SymI_NeedsProto(__aeabi_dmul) \
136136-- SymI_NeedsProto(__aeabi_dneg) \
137137-- SymI_NeedsProto(__aeabi_dsub) \
138138-- SymI_NeedsProto(__aeabi_f2d) \
139139-- SymI_NeedsProto(__aeabi_f2iz) \
140140-- SymI_NeedsProto(__aeabi_f2lz) \
141141-- SymI_NeedsProto(__aeabi_f2uiz) \
142142-- SymI_NeedsProto(__aeabi_f2ulz) \
143143-- SymI_NeedsProto(__aeabi_fadd) \
144144-- SymI_NeedsProto(__aeabi_fcmpeq) \
145145-- SymI_NeedsProto(__aeabi_fcmpge) \
146146-- SymI_NeedsProto(__aeabi_fcmpgt) \
147147-- SymI_NeedsProto(__aeabi_fcmple) \
148148-- SymI_NeedsProto(__aeabi_fcmplt) \
149149-- SymI_NeedsProto(__aeabi_fcmpun) \
150150-- SymI_NeedsProto(__aeabi_fdiv) \
151151-- SymI_NeedsProto(__aeabi_fmul) \
152152-- SymI_NeedsProto(__aeabi_fneg) \
153153-- SymI_NeedsProto(__aeabi_fsub) \
154154-- SymI_NeedsProto(__aeabi_i2d) \
155155-- SymI_NeedsProto(__aeabi_i2f) \
156156-- SymI_NeedsProto(__aeabi_idiv) \
157157-- SymI_NeedsProto(__aeabi_idivmod) \
158158-- SymI_NeedsProto(__aeabi_l2d) \
159159-- SymI_NeedsProto(__aeabi_l2f) \
160160-- SymI_NeedsProto(__aeabi_lasr) \
161161-- SymI_NeedsProto(__aeabi_lcmp) \
162162-- SymI_NeedsProto(__aeabi_ldivmod) \
163163-- SymI_NeedsProto(__aeabi_llsl) \
164164-- SymI_NeedsProto(__aeabi_llsr) \
165165-- SymI_NeedsProto(__aeabi_lmul) \
166166-- SymI_NeedsProto(__aeabi_ui2d) \
167167-- SymI_NeedsProto(__aeabi_ui2f) \
168168-- SymI_NeedsProto(__aeabi_uidiv) \
169169-- SymI_NeedsProto(__aeabi_uidivmod) \
170170-- SymI_NeedsProto(__aeabi_ul2d) \
171171-- SymI_NeedsProto(__aeabi_ul2f) \
172172-- SymI_NeedsProto(__aeabi_ulcmp) \
173173-- SymI_NeedsProto(__aeabi_uldivmod)
174174--#define RTS_LIBGCC_SYMBOLS_64 \
175175-+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
176176-+#define RTS_LIBGCC_SYMBOLS \
177177-+ SymI_NeedsProto(__divdi3) \
178178-+ SymI_NeedsProto(__udivdi3) \
179179-+ SymI_NeedsProto(__moddi3) \
180180-+ SymI_NeedsProto(__umoddi3) \
181181-+ SymI_NeedsProto(__muldi3) \
182182-+ SymI_NeedsProto(__ashldi3) \
183183-+ SymI_NeedsProto(__ashrdi3) \
184184-+ SymI_NeedsProto(__lshrdi3) \
185185-+ SymI_NeedsProto(__fixunsdfdi)
186186-+#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
187187-+#define RTS_LIBGCC_SYMBOLS \
188188- SymI_NeedsProto(__udivti3) \
189189- SymI_NeedsProto(__umodti3)
190190--
191191--/* for aarch64 */
192192--#define RTS_LIBGCC_SYMBOLS_aarch64 \
193193-- SymI_NeedsProto(__netf2) \
194194-- SymI_NeedsProto(__addtf3) \
195195-- SymI_NeedsProto(__subtf3) \
196196-- SymI_NeedsProto(__multf3) \
197197-- SymI_NeedsProto(__extenddftf2) \
198198-- SymI_NeedsProto(__fixtfsi) \
199199-- SymI_NeedsProto(__fixunstfsi) \
200200-- SymI_NeedsProto(__floatsitf) \
201201-- SymI_NeedsProto(__floatunsitf)
202202--
203203--#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && defined(arm_HOST_OS)
204204--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32 RTS_LIBGCC_SYMBOLS_aarch32
205205--#elif defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
206206--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_32
207207--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8 && defined(aarch64_HOST_OS)
208208--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64 RTS_LIBGCC_SYMBOLS_aarch64
209209--#elif defined(__GNUC__) && SIZEOF_VOID_P == 8
210210--#define RTS_LIBGCC_SYMBOLS RTS_LIBGCC_SYMBOLS_64
211211- #else
212212- #define RTS_LIBGCC_SYMBOLS
213213- #endif
214214-215215--#if !defined(mingw32_HOST_OS) && !defined(DYNAMIC) && (defined(_FORTIFY_SOURCE) || defined(__SSP__))
216216--#define RTS_SSP_SYMBOLS \
217217-- SymI_NeedsProto(__stack_chk_guard) \
218218-- SymI_NeedsProto(__stack_chk_fail)
219219--#else
220220--#define RTS_SSP_SYMBOLS
221221--#endif
222222--#if !defined(DYNAMIC) && defined(linux_HOST_OS)
223223--// we need these for static musl builds. However when
224224--// linking shared objects (DLLs) this will fail, hence
225225--// we do not include them when building with -DDYNAMIC
226226--#define RTS_LINKER_SYMBOLS \
227227-- SymI_NeedsProto(__fini_array_start) \
228228-- SymI_NeedsProto(__fini_array_end)
229229--#else
230230--#define RTS_LINKER_SYMBOLS
231231--#endif
232232--
233233--#if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
234234-- // Symbols that don't have a leading underscore
235235-- // on Mac OS X. They have to receive special treatment,
236236-- // see machoInitSymbolsWithoutUnderscore()
237237--#define RTS_MACHO_NOUNDERLINE_SYMBOLS \
238238-- SymI_NeedsProto(saveFP) \
239239-- SymI_NeedsProto(restFP)
240240--#endif
241241--
242242- /* entirely bogus claims about types of these symbols */
243243--/* to prevent a bit of define expansion, SymI_NeedsProto is a variadic
244244-- * macro. And we'll concat vvv with the __VA_ARGS__. This prevents
245245-- * vvv from getting macro expanded.
246246-- */
247247--#define SymI_NeedsProto(vvv,...) extern void vvv ## __VA_ARGS__ (void);
248248-+#define SymI_NeedsProto(vvv) extern void vvv(void);
249249- #define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
250250- #if defined(COMPILING_WINDOWS_DLL)
251251- #define SymE_HasProto(vvv) SymE_HasProto(vvv);
252252-@@ -1209,8 +1026,6 @@ RTS_DARWIN_ONLY_SYMBOLS
253253- RTS_OPENBSD_ONLY_SYMBOLS
254254- RTS_LIBGCC_SYMBOLS
255255- RTS_LIBFFI_SYMBOLS
256256--RTS_SSP_SYMBOLS
257257--RTS_LINKER_SYMBOLS
258258- #undef SymI_NeedsProto
259259- #undef SymI_NeedsDataProto
260260- #undef SymI_HasProto
261261-@@ -1230,7 +1045,7 @@ RTS_LINKER_SYMBOLS
262262- #define SymE_HasDataProto(vvv) \
263263- SymE_HasProto(vvv)
264264-265265--#define SymI_NeedsProto(vvv,...) SymI_HasProto(vvv ## __VA_ARGS__)
266266-+#define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
267267- #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
268268- #define SymE_NeedsProto(vvv) SymE_HasProto(vvv)
269269- #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv)
270270-@@ -1251,8 +1066,6 @@ RTS_LINKER_SYMBOLS
271271- #define SymI_HasProto_deprecated(vvv) \
272272- { #vvv, (void*)0xBAADF00D, true },
273273-274274--void *RTS_DYNAMIC = NULL;
275275--
276276- RtsSymbolVal rtsSyms[] = {
277277- RTS_SYMBOLS
278278- RTS_RET_SYMBOLS
279279-@@ -1264,14 +1077,11 @@ RtsSymbolVal rtsSyms[] = {
280280- RTS_LIBGCC_SYMBOLS
281281- RTS_LIBFFI_SYMBOLS
282282- SymI_HasDataProto(nonmoving_write_barrier_enabled)
283283-- RTS_SSP_SYMBOLS
284284-- RTS_LINKER_SYMBOLS
285285- #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
286286- // dyld stub code contains references to this,
287287- // but it should never be called because we treat
288288- // lazy pointers as nonlazy.
289289- { "dyld_stub_binding_helper", (void*)0xDEADBEEF, false },
290290- #endif
291291-- { "_DYNAMIC", (void*)(&RTS_DYNAMIC), false },
292292- { 0, 0, false } /* sentinel */
293293- };
294294---
295295-2.25.4
296296-
+2
pkgs/development/haskell-modules/HACKING.md
···249249 $ ./maintainers/scripts/haskell/merge-and-open-pr.sh PR_NUM_OF_CURRENT_HASKELL_UPDATES_PR
250250 ```
251251252252+ Find the PR number easily [here](https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates)
253253+252254 This does the following things:
253255254256 1. Fetches `origin`, makes sure you currently have the `haskell-updates`
···990990 enableSeparateBinOutput = true;
991991 }) super.nfc;
992992993993+ # Wants to execute cabal-install to (re-)build itself
994994+ hint = dontCheck super.hint;
995995+996996+ # Make sure that Cabal 3.8.* can be built as-is
997997+ Cabal_3_8_1_0 = doDistribute (super.Cabal_3_8_1_0.override {
998998+ Cabal-syntax = self.Cabal-syntax_3_8_1_0;
999999+ process = self.process_1_6_15_0;
10001000+ });
10011001+10021002+ # cabal-install switched to build type simple in 3.2.0.0
10031003+ # as a result, the cabal(1) man page is no longer installed
10041004+ # automatically. Instead we need to use the `cabal man`
10051005+ # command which generates the man page on the fly and
10061006+ # install it to $out/share/man/man1 ourselves in this
10071007+ # override.
10081008+ # The commit that introduced this change:
10091009+ # https://github.com/haskell/cabal/commit/91ac075930c87712eeada4305727a4fa651726e7
10101010+ # Since cabal-install 3.8, the cabal man (without the raw) command
10111011+ # uses nroff(1) instead of man(1) for macOS/BSD compatibility. That utility
10121012+ # is not commonly installed on systems, so we add it to PATH. Closure size
10131013+ # penalty is about 10MB at the time of writing this (2022-08-20).
10141014+ cabal-install = overrideCabal (old: {
10151015+ executableToolDepends = [
10161016+ pkgs.buildPackages.makeWrapper
10171017+ ] ++ old.buildToolDepends or [];
10181018+ postInstall = old.postInstall + ''
10191019+ mkdir -p "$out/share/man/man1"
10201020+ "$out/bin/cabal" man --raw > "$out/share/man/man1/cabal.1"
10211021+10221022+ wrapProgram "$out/bin/cabal" \
10231023+ --prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.groff ]}"
10241024+ '';
10251025+ hydraPlatforms = pkgs.lib.platforms.all;
10261026+ broken = false;
10271027+ }) super.cabal-install;
10281028+9931029# haskell-language-server plugins all use the same test harness so we give them what we want in this loop.
9941030} // pkgs.lib.mapAttrs
9951031 (_: overrideCabal (drv: {
···10211057 hls-call-hierarchy-plugin = dontCheck super.hls-call-hierarchy-plugin;
10221058 hls-selection-range-plugin = dontCheck super.hls-selection-range-plugin;
10231059 hls-ormolu-plugin = dontCheck super.hls-ormolu-plugin;
10241024-10251025- # Wants to execute cabal-install to (re-)build itself
10261026- hint = dontCheck super.hint;
10271060}