Zubin pushed to branch wip/9.10.3-backports at Glasgow Haskell Compiler / GHC
Commits:
-
90a90dc9
by doyougnu at 2025-07-25T05:28:40+05:30
-
4c43fe31
by Tamar Christina at 2025-07-25T05:28:40+05:30
-
79bb3645
by Zubin Duggal at 2025-07-25T05:28:40+05:30
19 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- configure.ac
- + docs/users_guide/9.10.3-notes.rst
- rts/Linker.c
- rts/LinkerInternals.h
- rts/linker/Elf.c
- rts/linker/ElfTypes.h
- rts/linker/PEi386.c
- testsuite/driver/testlib.py
- testsuite/tests/backpack/cabal/bkpcabal08/bkpcabal08.stdout
- testsuite/tests/driver/T20604/T20604.stdout
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/rts/linker/Makefile
- + testsuite/tests/rts/linker/T25191.hs
- + testsuite/tests/rts/linker/T25191.stdout
- + testsuite/tests/rts/linker/T25191_foo1.c
- + testsuite/tests/rts/linker/T25191_foo2.c
- testsuite/tests/rts/linker/all.T
Changes:
| ... | ... | @@ -997,9 +997,9 @@ job_groups = |
| 997 | 997 | -- Fully static build, in theory usable on any linux distribution.
|
| 998 | 998 | , fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static))
|
| 999 | 999 | -- Dynamically linked build, suitable for building your own static executables on alpine
|
| 1000 | - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla))
|
|
| 1000 | + , disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)))
|
|
| 1001 | 1001 | , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla))
|
| 1002 | - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine318) (splitSectionsBroken vanilla))
|
|
| 1002 | + , alpine318BrokenTests (disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine318) (splitSectionsBroken vanilla)))
|
|
| 1003 | 1003 | , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt)))
|
| 1004 | 1004 | , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
|
| 1005 | 1005 | |
| ... | ... | @@ -1024,6 +1024,8 @@ job_groups = |
| 1024 | 1024 | -- (see Note [Object unloading]).
|
| 1025 | 1025 | fullyStaticBrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "ghcilink002 linker_unload_native")
|
| 1026 | 1026 | |
| 1027 | + alpine318BrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "scc001")
|
|
| 1028 | + |
|
| 1027 | 1029 | hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage")
|
| 1028 | 1030 | |
| 1029 | 1031 | tsan_jobs =
|
| ... | ... | @@ -830,7 +830,7 @@ |
| 830 | 830 | ".gitlab/ci.sh clean",
|
| 831 | 831 | "cat ci_timings"
|
| 832 | 832 | ],
|
| 833 | - "allow_failure": false,
|
|
| 833 | + "allow_failure": true,
|
|
| 834 | 834 | "artifacts": {
|
| 835 | 835 | "expire_in": "8 weeks",
|
| 836 | 836 | "paths": [
|
| ... | ... | @@ -1006,7 +1006,7 @@ |
| 1006 | 1006 | "variables": {
|
| 1007 | 1007 | "BIGNUM_BACKEND": "gmp",
|
| 1008 | 1008 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-validate",
|
| 1009 | - "BROKEN_TESTS": "encoding004 T10458",
|
|
| 1009 | + "BROKEN_TESTS": "scc001 encoding004 T10458",
|
|
| 1010 | 1010 | "BUILD_FLAVOUR": "validate",
|
| 1011 | 1011 | "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
|
| 1012 | 1012 | "INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
|
| ... | ... | @@ -3244,7 +3244,7 @@ |
| 3244 | 3244 | ".gitlab/ci.sh clean",
|
| 3245 | 3245 | "cat ci_timings"
|
| 3246 | 3246 | ],
|
| 3247 | - "allow_failure": false,
|
|
| 3247 | + "allow_failure": true,
|
|
| 3248 | 3248 | "artifacts": {
|
| 3249 | 3249 | "expire_in": "1 year",
|
| 3250 | 3250 | "paths": [
|
| ... | ... | @@ -3358,7 +3358,7 @@ |
| 3358 | 3358 | "variables": {
|
| 3359 | 3359 | "BIGNUM_BACKEND": "gmp",
|
| 3360 | 3360 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-release+no_split_sections",
|
| 3361 | - "BROKEN_TESTS": "encoding004 T10458",
|
|
| 3361 | + "BROKEN_TESTS": "scc001 encoding004 T10458",
|
|
| 3362 | 3362 | "BUILD_FLAVOUR": "release+no_split_sections",
|
| 3363 | 3363 | "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check",
|
| 3364 | 3364 | "HADRIAN_ARGS": "--hash-unit-ids",
|
| ... | ... | @@ -22,7 +22,7 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [9.10.2], [glasgow-ha |
| 22 | 22 | AC_CONFIG_MACRO_DIRS([m4])
|
| 23 | 23 | |
| 24 | 24 | # Set this to YES for a released version, otherwise NO
|
| 25 | -: ${RELEASE=YES}
|
|
| 25 | +: ${RELEASE=NO}
|
|
| 26 | 26 | |
| 27 | 27 | # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line
|
| 28 | 28 | # above. If this is not a released version, then we will append the
|
| 1 | +.. _release-9-10-3:
|
|
| 2 | + |
|
| 3 | +Version 9.10.3
|
|
| 4 | +===============
|
|
| 5 | +The significant changes to the various parts of the compiler are listed in the
|
|
| 6 | +following sections. See the `migration guide
|
|
| 7 | +<https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.10>`_ on the GHC Wiki
|
|
| 8 | +for specific guidance on migrating programs to this release.
|
|
| 9 | + |
|
| 10 | + |
|
| 11 | +Compiler
|
|
| 12 | +~~~~~~~~
|
|
| 13 | + |
|
| 14 | +- Don't cache solved [W] HasCallStack constraints to avoid re-using old
|
|
| 15 | + call-stacks instead of constructing new ones. (:ghc-ticket:`25529`)
|
|
| 16 | + |
|
| 17 | +- Fix EmptyCase panic in tcMatches when \case{} is checked against a function
|
|
| 18 | + type preceded by invisible forall. (:ghc-ticket:`25960`)
|
|
| 19 | + |
|
| 20 | +- Fix panic triggered by combination of \case{} and forall t ->. (:ghc-ticket:`25004`)
|
|
| 21 | + |
|
| 22 | +- Fix GHC.SysTools.Ar archive member size writing logic that was emitting wrong
|
|
| 23 | + archive member sizes in headers. (:ghc-ticket:`26120`, :ghc-ticket:`22586`)
|
|
| 24 | + |
|
| 25 | +- Fix multiple bugs in name resolution of subordinate import lists related to
|
|
| 26 | + type namespace specifiers and hiding clauses. (:ghc-ticket:`22581`, :ghc-ticket:`25983`, :ghc-ticket:`25984`, :ghc-ticket:`25991`)
|
|
| 27 | + |
|
| 28 | +- Use mkTrAppChecked in ds_ev_typeable to avoid false negatives for type
|
|
| 29 | + equality involving function types. (:ghc-ticket:`25998`)
|
|
| 30 | + |
|
| 31 | +- Fix bytecode generation for ``tagToEnum# <LITERAL>``. (:ghc-ticket:`25975`)
|
|
| 32 | + |
|
| 33 | +- Don't report used duplicate record fields as unused. (:ghc-ticket:`24035`)
|
|
| 34 | + |
|
| 35 | +- Propagate long distance info to guarded let binds for better pattern-match
|
|
| 36 | + checking warnings. (:ghc-ticket:`25749`)
|
|
| 37 | + |
|
| 38 | +- Prevent incorrect unpacking optimizations for GADTs with multiple constructors. (:ghc-ticket:`25672`)
|
|
| 39 | + |
|
| 40 | +- Introduce a separate argument limit for forced specs via SPEC argument with
|
|
| 41 | + warning when limit is exceeded. (:ghc-ticket:`25197`)
|
|
| 42 | + |
|
| 43 | +Build system and packaging
|
|
| 44 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 45 | + |
|
| 46 | +- 9.10 hadrian can build with Cabal-3.12.1. (:ghc-ticket:`25605`)
|
|
| 47 | + |
|
| 48 | +- GHC settings: always unescape escaped spaces to fix handling of spaces in
|
|
| 49 | + executable paths. (:ghc-ticket:`25204`)
|
|
| 50 | + |
|
| 51 | +Native code generator backend
|
|
| 52 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 53 | + |
|
| 54 | +- x86 NCG: Fix code generation of bswap64 on i386. (:ghc-ticket:`25601`)
|
|
| 55 | + |
|
| 56 | +- AArch64 NCG: Fix sub-word arithmetic right shift by zero-extending sub-word
|
|
| 57 | + values. (:ghc-ticket:`26061`)
|
|
| 58 | + |
|
| 59 | +- NCG: AArch64 - Add -finter-module-far-jumps flag for modules with far jumps
|
|
| 60 | + outside the current module. (:ghc-ticket:`24648`)
|
|
| 61 | + |
|
| 62 | +LLVM backend
|
|
| 63 | +~~~~~~~~~~~~
|
|
| 64 | + |
|
| 65 | +- LLVM: fix typo in padLiveArgs that was incorrectly computing too many padding
|
|
| 66 | + registers causing segfaults. (:ghc-ticket:`25770`, :ghc-ticket:`25773`)
|
|
| 67 | + |
|
| 68 | +- llvmGen: Fix linkage of built-in arrays to use Appending linkage instead of
|
|
| 69 | + Internal. (:ghc-ticket:`25769`)
|
|
| 70 | + |
|
| 71 | +- llvmGen: Fix built-in variable predicate to check for `@llvm` rather than
|
|
| 72 | + `$llvm`.
|
|
| 73 | + |
|
| 74 | +WebAssembly backend
|
|
| 75 | +~~~~~~~~~~~~~~~~~~~
|
|
| 76 | + |
|
| 77 | +- wasm: use primitive opcodes for fabs and sqrt operations.
|
|
| 78 | + |
|
| 79 | +Runtime system
|
|
| 80 | +~~~~~~~~~~~~~~
|
|
| 81 | + |
|
| 82 | +- rts: Implement WEAK EXTERNAL undef redirection by target symbol name.
|
|
| 83 | + |
|
| 84 | +- rts: Handle API set symbol versioning conflicts.
|
|
| 85 | + |
|
| 86 | +- rts: fix rts_clearMemory logic when sanity checks are enabled. (:ghc-ticket:`26011`)
|
|
| 87 | + |
|
| 88 | +- rts/linker: Improve efficiency of proddable blocks structure by using binary
|
|
| 89 | + search instead of linked lists for better performance with split sections. (:ghc-ticket:`26009`)
|
|
| 90 | + |
|
| 91 | +- rts/linker/PEi386: Don't repeatedly load DLLs by maintaining a hash-set of
|
|
| 92 | + loaded DLL names. (:ghc-ticket:`26009`, :ghc-ticket:`26052`)
|
|
| 93 | + |
|
| 94 | +- rts/linker: Don't fail due to RTLD_NOW by attempting eager binding first,
|
|
| 95 | + then reverting to lazy binding on failure. (:ghc-ticket:`25943`)
|
|
| 96 | + |
|
| 97 | +``base`` library
|
|
| 98 | +~~~~~~~~~~~~~~~~
|
|
| 99 | + |
|
| 100 | +- base: Expose Backtraces constructor and fields. (:ghc-ticket:`26049`)
|
|
| 101 | + |
|
| 102 | +- base: Note strictness changes made in 4.16.0.0. (:ghc-ticket:`25886`)
|
|
| 103 | + |
|
| 104 | +- Fix bugs in ``integerRecipMod`` and ``integerPowMod`` return values. (:ghc-ticket:`26017`)
|
|
| 105 | + |
|
| 106 | +``ghc`` library
|
|
| 107 | +~~~~~~~~~~~~~~~
|
|
| 108 | + |
|
| 109 | +- perf: Replace uses of genericLength with strictGenericLength to reduce time
|
|
| 110 | + spent in 'assembleBCOs' and allocations. (:ghc-ticket:`25706`)
|
|
| 111 | + |
|
| 112 | +Build tools
|
|
| 113 | +~~~~~~~~~~~
|
|
| 114 | + |
|
| 115 | +- configure: Drop probing of ld.gold since `gold` has been dropped from
|
|
| 116 | + binutils-2.44. (:ghc-ticket:`25716`)
|
|
| 117 | + |
|
| 118 | +- get-win32-tarballs.py: List tarball files to be downloaded if we cannot find
|
|
| 119 | + them. (:ghc-ticket:`25929`)
|
|
| 120 | + |
|
| 121 | +- hp2ps Utilities.c: include stdlib.h instead of extern malloc and realloc.
|
|
| 122 | + |
|
| 123 | +Included libraries
|
|
| 124 | +~~~~~~~~~~~~~~~~~~
|
|
| 125 | + |
|
| 126 | +The package database provided with this distribution also contains a number of
|
|
| 127 | +packages other than GHC itself. See the changelogs provided with these packages
|
|
| 128 | +for further change information.
|
|
| 129 | + |
|
| 130 | +.. ghc-package-list::
|
|
| 131 | + |
|
| 132 | + libraries/array/array.cabal: Dependency of ``ghc`` library
|
|
| 133 | + libraries/base/base.cabal: Core library
|
|
| 134 | + libraries/binary/binary.cabal: Dependency of ``ghc`` library
|
|
| 135 | + libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library
|
|
| 136 | + libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility
|
|
| 137 | + libraries/Cabal/Cabal-syntax/Cabal-syntax.cabal: Dependency of ``ghc-pkg`` utility
|
|
| 138 | + libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library
|
|
| 139 | + libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library
|
|
| 140 | + libraries/directory/directory.cabal: Dependency of ``ghc`` library
|
|
| 141 | + libraries/exceptions/exceptions.cabal: Dependency of ``ghc`` and ``haskeline`` library
|
|
| 142 | + libraries/filepath/filepath.cabal: Dependency of ``ghc`` library
|
|
| 143 | + compiler/ghc.cabal: The compiler itself
|
|
| 144 | + libraries/ghci/ghci.cabal: The REPL interface
|
|
| 145 | + libraries/ghc-boot/ghc-boot.cabal: Internal compiler library
|
|
| 146 | + libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library
|
|
| 147 | + libraries/ghc-compact/ghc-compact.cabal: Core library
|
|
| 148 | + libraries/ghc-heap/ghc-heap.cabal: GHC heap-walking library
|
|
| 149 | + libraries/ghc-prim/ghc-prim.cabal: Core library
|
|
| 150 | + libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable
|
|
| 151 | + libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable
|
|
| 152 | + libraries/integer-gmp/integer-gmp.cabal: Core library
|
|
| 153 | + libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library
|
|
| 154 | + libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library
|
|
| 155 | + libraries/pretty/pretty.cabal: Dependency of ``ghc`` library
|
|
| 156 | + libraries/process/process.cabal: Dependency of ``ghc`` library
|
|
| 157 | + libraries/stm/stm.cabal: Dependency of ``haskeline`` library
|
|
| 158 | + libraries/template-haskell/template-haskell.cabal: Core library
|
|
| 159 | + libraries/terminfo/terminfo.cabal: Dependency of ``haskeline`` library
|
|
| 160 | + libraries/text/text.cabal: Dependency of ``Cabal`` library
|
|
| 161 | + libraries/time/time.cabal: Dependency of ``ghc`` library
|
|
| 162 | + libraries/transformers/transformers.cabal: Dependency of ``ghc`` library
|
|
| 163 | + libraries/unix/unix.cabal: Dependency of ``ghc`` library
|
|
| 164 | + libraries/Win32/Win32.cabal: Dependency of ``ghc`` library
|
|
| 165 | + libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable |
|
| \ No newline at end of file |
| ... | ... | @@ -232,11 +232,11 @@ static void ghciRemoveSymbolTable(StrHashTable *table, const SymbolName* key, |
| 232 | 232 | static const char *
|
| 233 | 233 | symbolTypeString (SymType type)
|
| 234 | 234 | {
|
| 235 | - switch (type & ~SYM_TYPE_DUP_DISCARD) {
|
|
| 235 | + switch (type & ~(SYM_TYPE_DUP_DISCARD | SYM_TYPE_HIDDEN)) {
|
|
| 236 | 236 | case SYM_TYPE_CODE: return "code";
|
| 237 | 237 | case SYM_TYPE_DATA: return "data";
|
| 238 | 238 | case SYM_TYPE_INDIRECT_DATA: return "indirect-data";
|
| 239 | - default: barf("symbolTypeString: unknown symbol type");
|
|
| 239 | + default: barf("symbolTypeString: unknown symbol type (%d)", type);
|
|
| 240 | 240 | }
|
| 241 | 241 | }
|
| 242 | 242 | |
| ... | ... | @@ -283,10 +283,19 @@ int ghciInsertSymbolTable( |
| 283 | 283 | }
|
| 284 | 284 | else if (pinfo->type ^ type)
|
| 285 | 285 | {
|
| 286 | + if(pinfo->type & SYM_TYPE_HIDDEN)
|
|
| 287 | + {
|
|
| 288 | + /* The existing symbol is hidden, let's replace it */
|
|
| 289 | + pinfo->value = data;
|
|
| 290 | + pinfo->owner = owner;
|
|
| 291 | + pinfo->strength = strength;
|
|
| 292 | + pinfo->type = type;
|
|
| 293 | + return 1;
|
|
| 294 | + }
|
|
| 286 | 295 | /* We were asked to discard the symbol on duplicates, do so quietly. */
|
| 287 | - if (!(type & SYM_TYPE_DUP_DISCARD))
|
|
| 296 | + if (!(type & (SYM_TYPE_DUP_DISCARD | SYM_TYPE_HIDDEN)))
|
|
| 288 | 297 | {
|
| 289 | - debugBelch("Symbol type mismatch.\n");
|
|
| 298 | + debugBelch("Symbol type mismatch (existing %d, new %d).\n", pinfo->type, type);
|
|
| 290 | 299 | debugBelch("Symbol %s was defined by %" PATH_FMT " to be a %s symbol.\n",
|
| 291 | 300 | key, obj_name, symbolTypeString(type));
|
| 292 | 301 | debugBelch(" yet was defined by %" PATH_FMT " to be a %s symbol.\n",
|
| ... | ... | @@ -65,6 +65,8 @@ typedef enum _SymType { |
| 65 | 65 | SYM_TYPE_DUP_DISCARD = 1 << 3, /* the symbol is a symbol in a BFD import library
|
| 66 | 66 | however if a duplicate is found with a mismatching
|
| 67 | 67 | SymType then discard this one. */
|
| 68 | + SYM_TYPE_HIDDEN = 1 << 4, /* the symbol is hidden and should not be exported */
|
|
| 69 | + |
|
| 68 | 70 | } SymType;
|
| 69 | 71 | |
| 70 | 72 |
| ... | ... | @@ -1073,6 +1073,9 @@ ocGetNames_ELF ( ObjectCode* oc ) |
| 1073 | 1073 | } else {
|
| 1074 | 1074 | sym_type = SYM_TYPE_DATA;
|
| 1075 | 1075 | }
|
| 1076 | + if(ELF_ST_VISIBILITY(symbol->elf_sym->st_other) == STV_HIDDEN) {
|
|
| 1077 | + sym_type |= SYM_TYPE_HIDDEN;
|
|
| 1078 | + }
|
|
| 1076 | 1079 | |
| 1077 | 1080 | /* And the decision is ... */
|
| 1078 | 1081 |
| ... | ... | @@ -33,6 +33,9 @@ |
| 33 | 33 | #define Elf_Sym Elf64_Sym
|
| 34 | 34 | #define Elf_Rel Elf64_Rel
|
| 35 | 35 | #define Elf_Rela Elf64_Rela
|
| 36 | +#if !defined(ELF_ST_VISIBILITY)
|
|
| 37 | +#define ELF_ST_VISIBILITY ELF64_ST_VISIBILITY
|
|
| 38 | +#endif
|
|
| 36 | 39 | #if !defined(ELF_ST_TYPE)
|
| 37 | 40 | #define ELF_ST_TYPE ELF64_ST_TYPE
|
| 38 | 41 | #endif
|
| ... | ... | @@ -57,6 +60,9 @@ |
| 57 | 60 | #define Elf_Sym Elf32_Sym
|
| 58 | 61 | #define Elf_Rel Elf32_Rel
|
| 59 | 62 | #define Elf_Rela Elf32_Rela
|
| 63 | +#if !defined(ELF_ST_VISIBILITY)
|
|
| 64 | +#define ELF_ST_VISIBILITY ELF32_ST_VISIBILITY
|
|
| 65 | +#endif /* ELF_ST_VISIBILITY */
|
|
| 60 | 66 | #if !defined(ELF_ST_TYPE)
|
| 61 | 67 | #define ELF_ST_TYPE ELF32_ST_TYPE
|
| 62 | 68 | #endif /* ELF_ST_TYPE */
|
| ... | ... | @@ -1181,8 +1181,10 @@ bool checkAndLoadImportLibrary( pathchar* arch_name, char* member_name, FILE* f |
| 1181 | 1181 | // Because the symbol has been loaded before we actually need it, if a
|
| 1182 | 1182 | // stronger reference wants to add a duplicate we should discard this
|
| 1183 | 1183 | // one to preserve link order.
|
| 1184 | - if (!ghciInsertSymbolTable(dll, symhash, symbol, sym, false,
|
|
| 1185 | - SYM_TYPE_CODE | SYM_TYPE_DUP_DISCARD, NULL))
|
|
| 1184 | + SymType symType = SYM_TYPE_DUP_DISCARD | SYM_TYPE_HIDDEN;
|
|
| 1185 | + symType |= hdr.Type == IMPORT_OBJECT_CODE ? SYM_TYPE_CODE : SYM_TYPE_DATA;
|
|
| 1186 | + |
|
| 1187 | + if (!ghciInsertSymbolTable(dll, symhash, symbol, sym, false, symType, NULL))
|
|
| 1186 | 1188 | return false;
|
| 1187 | 1189 | |
| 1188 | 1190 | return true;
|
| ... | ... | @@ -2080,6 +2082,9 @@ ocGetNames_PEi386 ( ObjectCode* oc ) |
| 2080 | 2082 | sname[size-start]='\0';
|
| 2081 | 2083 | stgFree(tmp);
|
| 2082 | 2084 | sname = strdup (sname);
|
| 2085 | + if(secNumber == IMAGE_SYM_UNDEFINED)
|
|
| 2086 | + type |= SYM_TYPE_HIDDEN;
|
|
| 2087 | + |
|
| 2083 | 2088 | if (!ghciInsertSymbolTable(oc->fileName, symhash, sname,
|
| 2084 | 2089 | addr, false, type, oc))
|
| 2085 | 2090 | return false;
|
| ... | ... | @@ -2094,6 +2099,8 @@ ocGetNames_PEi386 ( ObjectCode* oc ) |
| 2094 | 2099 | && (!section || (section && section->kind != SECTIONKIND_IMPORT))) {
|
| 2095 | 2100 | /* debugBelch("addSymbol %p `%s' Weak:%lld \n", addr, sname, isWeak); */
|
| 2096 | 2101 | sname = strdup (sname);
|
| 2102 | + if(secNumber == IMAGE_SYM_UNDEFINED)
|
|
| 2103 | + type |= SYM_TYPE_HIDDEN;
|
|
| 2097 | 2104 | IF_DEBUG(linker_verbose, debugBelch("addSymbol %p `%s'\n", addr, sname));
|
| 2098 | 2105 | ASSERT(i < (uint32_t)oc->n_symbols);
|
| 2099 | 2106 | oc->symbols[i].name = sname;
|
| ... | ... | @@ -2125,7 +2132,7 @@ static size_t |
| 2125 | 2132 | makeSymbolExtra_PEi386( ObjectCode* oc, uint64_t index STG_UNUSED, size_t s, char* symbol STG_UNUSED, SymType type )
|
| 2126 | 2133 | {
|
| 2127 | 2134 | SymbolExtra *extra;
|
| 2128 | - switch(type & ~SYM_TYPE_DUP_DISCARD) {
|
|
| 2135 | + switch(type & ~(SYM_TYPE_DUP_DISCARD | SYM_TYPE_HIDDEN)) {
|
|
| 2129 | 2136 | case SYM_TYPE_CODE: {
|
| 2130 | 2137 | // jmp *-14(%rip)
|
| 2131 | 2138 | extra = m32_alloc(oc->rx_m32, sizeof(SymbolExtra), 8);
|
| ... | ... | @@ -1493,7 +1493,7 @@ async def do_test(name: TestName, |
| 1493 | 1493 | dst_makefile = in_testdir('Makefile')
|
| 1494 | 1494 | if src_makefile.exists():
|
| 1495 | 1495 | makefile = src_makefile.read_text(encoding='UTF-8')
|
| 1496 | - makefile = re.sub('TOP=.*', 'TOP=%s' % config.top, makefile, 1)
|
|
| 1496 | + makefile = re.sub('TOP=.*', 'TOP=%s' % config.top, makefile, count=1)
|
|
| 1497 | 1497 | dst_makefile.write_text(makefile, encoding='UTF-8')
|
| 1498 | 1498 | |
| 1499 | 1499 | if opts.pre_cmd:
|
| ... | ... | @@ -2708,7 +2708,7 @@ def normalise_errmsg(s: str) -> str: |
| 2708 | 2708 | |
| 2709 | 2709 | # filter out unsupported GNU_PROPERTY_TYPE (5), which is emitted by LLVM10
|
| 2710 | 2710 | # and not understood by older binutils (ar, ranlib, ...)
|
| 2711 | - s = modify_lines(s, lambda l: re.sub(r'^(.+)warning: (.+): unsupported GNU_PROPERTY_TYPE \(5\) type: 0xc000000(.*)$', '', l))
|
|
| 2711 | + s = modify_lines(s, lambda l: re.sub(r'^(.+)warning: (.+): unsupported GNU_PROPERTY_TYPE (?: \(5\) )? type: 0xc000000(.*)$', '', l))
|
|
| 2712 | 2712 | |
| 2713 | 2713 | s = re.sub(r'ld: warning: passed .* min versions \(.*\) for platform macOS. Using [\.0-9]+.','',s)
|
| 2714 | 2714 | s = re.sub('ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version','',s)
|
| ... | ... | @@ -13,13 +13,13 @@ Building library 'q' instantiated with |
| 13 | 13 | for bkpcabal08-0.1.0.0...
|
| 14 | 14 | [2 of 4] Compiling B[sig] ( q/B.hsig, nothing )
|
| 15 | 15 | [3 of 4] Compiling M ( q/M.hs, nothing ) [A changed]
|
| 16 | -[4 of 4] Instantiating bkpcabal08-0.1.0.0-5O1mUtZZLBeDZEqqtwJcCj-p
|
|
| 16 | +[4 of 4] Instantiating bkpcabal08-0.1.0.0-Asivy2QkF0WEbGENiw5nyj-p
|
|
| 17 | 17 | Preprocessing library 'q' for bkpcabal08-0.1.0.0...
|
| 18 | 18 | Building library 'q' instantiated with
|
| 19 | - A = bkpcabal08-0.1.0.0-DlVb5PcmUolGCHYbfTL7EP-impl:A
|
|
| 20 | - B = bkpcabal08-0.1.0.0-DlVb5PcmUolGCHYbfTL7EP-impl:B
|
|
| 19 | + A = bkpcabal08-0.1.0.0-BznDTmYyvWf7fdEdPEncB4-impl:A
|
|
| 20 | + B = bkpcabal08-0.1.0.0-BznDTmYyvWf7fdEdPEncB4-impl:B
|
|
| 21 | 21 | for bkpcabal08-0.1.0.0...
|
| 22 | -[1 of 3] Compiling A[sig] ( q/A.hsig, dist/build/bkpcabal08-0.1.0.0-LFiTKyjPqyn9yyuysCoVKg-q+5IA1jA4bEzCFcXtraqAC38/A.o ) [Prelude package changed]
|
|
| 23 | -[2 of 3] Compiling B[sig] ( q/B.hsig, dist/build/bkpcabal08-0.1.0.0-LFiTKyjPqyn9yyuysCoVKg-q+5IA1jA4bEzCFcXtraqAC38/B.o ) [Prelude package changed]
|
|
| 22 | +[1 of 3] Compiling A[sig] ( q/A.hsig, dist/build/bkpcabal08-0.1.0.0-BOgmYfE3t0l9LsOUH0dl5H-q+sLNLgjkt61DMZK9wGbx81/A.o ) [Prelude package changed]
|
|
| 23 | +[2 of 3] Compiling B[sig] ( q/B.hsig, dist/build/bkpcabal08-0.1.0.0-BOgmYfE3t0l9LsOUH0dl5H-q+sLNLgjkt61DMZK9wGbx81/B.o ) [Prelude package changed]
|
|
| 24 | 24 | Preprocessing library 'r' for bkpcabal08-0.1.0.0...
|
| 25 | 25 | Building library 'r' for bkpcabal08-0.1.0.0... |
| 1 | 1 | A1
|
| 2 | 2 | A
|
| 3 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSghc-prim-0.10.0-inplace-ghc9.9.20230815.so" 1403aed32fb9af243c4cc949007c846c
|
|
| 4 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSghc-bignum-1.3-inplace-ghc9.9.20230815.so" 54293f8faab737bac998f6e1a1248db8
|
|
| 5 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSghc-internal-0.1.0.0-inplace-ghc9.9.20230815.so" a5c0e962d84d9044d44df4698becddcc
|
|
| 6 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSbase-4.19.0.0-inplace-ghc9.9.20230815.so" 4a90ed136fe0f89e5d0360daded517bd
|
|
| 7 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSghc-boot-th-9.9-inplace-ghc9.9.20230815.so" e338655f71b1d37fdfdd2504b7de6e76
|
|
| 8 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSarray-0.5.6.0-inplace-ghc9.9.20230815.so" 6943478e8adaa043abf7a2b38dd435a2
|
|
| 9 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSdeepseq-1.5.0.0-inplace-ghc9.9.20230815.so" 9974eb196694990ac6bb3c2591405de0
|
|
| 10 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHSpretty-1.1.3.6-inplace-ghc9.9.20230815.so" 1eefc21514f5584086f62b70aa554b7d
|
|
| 11 | -addDependentFile "/home/ben/ghc/ghc-compare-2/_build/stage1/lib/../lib/x86_64-linux-ghc-9.9.20230815/libHStemplate-haskell-2.21.0.0-inplace-ghc9.9.20230815.so" f85c86eb94dcce1eacd739b6e991ba2d |
|
| 3 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSghc-prim-0.12.0-inplace-ghc9.10.2.20250724.so" 0b7cbf5659e1fd221ea306e2da08c7d3
|
|
| 4 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSghc-bignum-1.3-inplace-ghc9.10.2.20250724.so" 1c29a409bcfbc31a3cfc2ded7c1d5530
|
|
| 5 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSghc-internal-9.1002.0-inplace-ghc9.10.2.20250724.so" 9606aee1cbbee934848aa85568563754
|
|
| 6 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSbase-4.20.1.0-inplace-ghc9.10.2.20250724.so" 5d1ab384becff6d4b20bae121d55fbc8
|
|
| 7 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSghc-boot-th-9.10.2.20250724-inplace-ghc9.10.2.20250724.so" 930b5206ff48d75ba522e582262695a8
|
|
| 8 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSdeepseq-1.5.2.0-inplace-ghc9.10.2.20250724.so" db23e7880c9a9fee0d494b48294c3487
|
|
| 9 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHSpretty-1.1.3.6-inplace-ghc9.10.2.20250724.so" ad484cfb103f02509b1be6abcf2a402f
|
|
| 10 | +addDependentFile "/home/zubin/ghcs/unicode-lex/_build_/stage1/lib/../lib/x86_64-linux-ghc-9.10.2.20250724/libHStemplate-haskell-2.22.0.0-inplace-ghc9.10.2.20250724.so" 50b2cb166e6e5293c24be374ffac2ade |
| ... | ... | @@ -27,12 +27,12 @@ instance [safe] Eq w => Eq (Maybe w) |
| 27 | 27 | -- Defined in ‘GHC.Internal.Maybe’
|
| 28 | 28 | instance GHC.Internal.Generics.Generic [w]
|
| 29 | 29 | -- Defined in ‘GHC.Internal.Generics’
|
| 30 | -instance Monoid [w] -- Defined in ‘GHC.Internal.Base’
|
|
| 31 | -instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’
|
|
| 32 | 30 | instance Read w => Read [w] -- Defined in ‘GHC.Internal.Read’
|
| 33 | 31 | instance Eq w => Eq [w] -- Defined in ‘GHC.Classes’
|
| 34 | 32 | instance Ord w => Ord [w] -- Defined in ‘GHC.Classes’
|
| 35 | 33 | instance Show w => Show [w] -- Defined in ‘GHC.Internal.Show’
|
| 34 | +instance Monoid [w] -- Defined in ‘GHC.Internal.Base’
|
|
| 35 | +instance Semigroup [w] -- Defined in ‘GHC.Internal.Base’
|
|
| 36 | 36 | instance [safe] MyShow w => MyShow [w]
|
| 37 | 37 | -- Defined at ghci064.hs:8:10
|
| 38 | 38 | instance GHC.Internal.Generics.Generic [T]
|
| ... | ... | @@ -145,3 +145,10 @@ reloc-none: |
| 145 | 145 | "$(TEST_HC)" load-object.c -o load-object -no-hs-main -debug
|
| 146 | 146 | "$(TEST_HC)" -c reloc-none.c -o reloc-none.o
|
| 147 | 147 | ./load-object reloc-none.o
|
| 148 | + |
|
| 149 | +.PHONY: T25191
|
|
| 150 | +T25191:
|
|
| 151 | + "$(TEST_HC)" -c T25191_foo1.c -o foo1.o -v0
|
|
| 152 | + "$(TEST_HC)" -c T25191_foo2.c -o foo2.o -v0
|
|
| 153 | + "$(TEST_HC)" T25191.hs -v0
|
|
| 154 | + ./T25191 |
| 1 | +{-# LANGUAGE ForeignFunctionInterface, CPP #-}
|
|
| 2 | +import Foreign.C.String
|
|
| 3 | +import Control.Monad
|
|
| 4 | +import System.FilePath
|
|
| 5 | +import Foreign.Ptr
|
|
| 6 | + |
|
| 7 | +-- Type of paths is different on Windows
|
|
| 8 | +#if defined(mingw32_HOST_OS)
|
|
| 9 | +type PathString = CWString
|
|
| 10 | +withPathString = withCWString
|
|
| 11 | +#else
|
|
| 12 | +type PathString = CString
|
|
| 13 | +withPathString = withCString
|
|
| 14 | +#endif
|
|
| 15 | + |
|
| 16 | +main = do
|
|
| 17 | + initLinker
|
|
| 18 | + r1 <- withPathString "foo1.o" loadObj
|
|
| 19 | + when (r1 /= 1) $ error "loadObj failed"
|
|
| 20 | + r2 <- withPathString "foo2.o" loadObj
|
|
| 21 | + when (r2 /= 1) $ error "loadObj failed"
|
|
| 22 | + r <- resolveObjs
|
|
| 23 | + when (r /= 1) $ error "resolveObj failed"
|
|
| 24 | + putStrLn "success"
|
|
| 25 | + |
|
| 26 | +foreign import ccall "initLinker" initLinker :: IO ()
|
|
| 27 | +foreign import ccall "addDLL" addDLL :: PathString -> IO CString
|
|
| 28 | +foreign import ccall "loadObj" loadObj :: PathString -> IO Int
|
|
| 29 | +foreign import ccall "resolveObjs" resolveObjs :: IO Int |
| 1 | +success |
| 1 | +#include <stdio.h>
|
|
| 2 | + |
|
| 3 | +void __attribute__ ((__visibility__ ("hidden"))) foo(void) {
|
|
| 4 | + printf("HIDDEN FOO\n");
|
|
| 5 | +}
|
|
| 6 | + |
|
| 7 | +void bar(void) {
|
|
| 8 | + printf("BAR\n");
|
|
| 9 | + foo();
|
|
| 10 | +} |
| 1 | +#include <stdio.h>
|
|
| 2 | + |
|
| 3 | +extern void bar(void);
|
|
| 4 | + |
|
| 5 | +void foo(void) {
|
|
| 6 | + printf("VISIBLE FOO\n");
|
|
| 7 | + bar();
|
|
| 8 | +} |
| ... | ... | @@ -168,3 +168,11 @@ test('reloc-none', |
| 168 | 168 | unless(opsys('linux'), skip),
|
| 169 | 169 | req_rts_linker],
|
| 170 | 170 | makefile_test, ['reloc-none'])
|
| 171 | + |
|
| 172 | +test('T25191',
|
|
| 173 | + [req_rts_linker,
|
|
| 174 | + extra_files(['T25191_foo1.c','T25191_foo2.c']),
|
|
| 175 | + when(opsys('darwin'), expect_broken(25191)), # not supported in the MachO linker yet
|
|
| 176 | + when(opsys('mingw32'), expect_broken(25191)) # not supported in the PE linker yet
|
|
| 177 | + ],
|
|
| 178 | + makefile_test, ['T25191']) |