[Git][ghc/ghc][wip/angerman/aarch64-ncg] 3 commits: Fix spelling

Moritz Angermann gitlab at gitlab.haskell.org
Tue Oct 27 08:45:41 UTC 2020



Moritz Angermann pushed to branch wip/angerman/aarch64-ncg at Glasgow Haskell Compiler / GHC


Commits:
1180fca2 by Moritz Angermann at 2020-10-27T15:30:33+08:00
Fix spelling

- - - - -
022ac19c by Moritz Angermann at 2020-10-27T16:35:08+08:00
Drop mmap_next (not needed with forced PIC anymore)

- - - - -
cf91bf47 by Moritz Angermann at 2020-10-27T16:35:32+08:00
[testsuite] static001 is not broken anymore.

- - - - -


4 changed files:

- compiler/GHC/Driver/Session.hs
- rts/Linker.c
- rts/LinkerInternals.h
- testsuite/tests/driver/all.T


Changes:

=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -3818,8 +3818,8 @@ default_PIC :: Platform -> [GeneralFlag]
 default_PIC platform =
   case (platformOS platform, platformArch platform) of
     (OSDarwin,  ArchX86_64)  -> [Opt_PIC]
-    (OSDarwin,  ArchAarch64) -> [Opt_PIC]
-    (OSLinux,   ArchAarch64) -> [Opt_PIC, Opt_ExternalDynamicRefs]
+    (OSDarwin,  ArchAArch64) -> [Opt_PIC]
+    (OSLinux,   ArchAArch64) -> [Opt_PIC, Opt_ExternalDynamicRefs]
     (OSOpenBSD, ArchX86_64)  -> [Opt_PIC] -- Due to PIE support in
                                          -- OpenBSD since 5.3 release
                                          -- (1 May 2013) we need to


=====================================
rts/Linker.c
=====================================
@@ -1052,42 +1052,6 @@ resolveSymbolAddr (pathchar* buffer, int size,
 }
 
 #if RTS_LINKER_USE_MMAP
-
-/* -----------------------------------------------------------------------------
-   Occationally we depend on mmap'd region being close to already mmap'd regions.
-
-   Our static in-memory linker may be restricted by the architectures relocation
-   range. E.g. aarch64 has a +-4GB range for PIC code, thus we'd preferrably
-   get memory for the linker close to existing mappings.  mmap on it's own is
-   free to return any memory location, independent of what the preferred
-   location argument indicates.
-
-   For example mmap (via qemu) might give you addresses all over the available
-   memory range if the requested location is already occupied.
-
-   mmap_next will do a linear search from the start page upwards to find a
-   suitable location that is as close as possible to the locations (proivded
-   via the first argument).
-   -------------------------------------------------------------------------- */
-
-void*
-mmap_next(void *addr, size_t length, int prot, int flags, int fd, off_t offset) {
-  if(addr == NULL) return mmap(addr, length, prot, flags, fd, offset);
-  // we are going to look for up to pageSize * 1024 * 1024 (4GB) from the
-  // address.
-  size_t pageSize = getPageSize();
-  for(int i = (uintptr_t)addr & (pageSize-1) ? 1 : 0; i < 1024*1024; i++) {
-    void *target = (void*)(((uintptr_t)addr & ~(pageSize-1))+(i*pageSize));
-    void *mem = mmap(target, length, prot, flags, fd, offset);
-    if(mem == NULL) return mem;
-    if(mem == target) return mem;
-    munmap(mem, length);
-    IF_DEBUG(linker && (i % 1024 == 0),
-      debugBelch("mmap_next failed to find suitable space in %p - %p\n", addr, target));
-  }
-  return NULL;
-}
-
 //
 // Returns NULL on failure.
 //
@@ -1119,8 +1083,8 @@ mmap_again:
             debugBelch("mmapForLinker: \tflags      %#0x\n",
                        MAP_PRIVATE | tryMap32Bit | fixed | flags));
 
-   result = mmap_next(map_addr, size, prot,
-                      MAP_PRIVATE|tryMap32Bit|fixed|flags, fd, offset);
+   result = mmap(map_addr, size, prot,
+                 MAP_PRIVATE|tryMap32Bit|fixed|flags, fd, offset);
 
    if (result == MAP_FAILED) {
        sysErrorBelch("mmap %" FMT_Word " bytes at %p",(W_)size,map_addr);


=====================================
rts/LinkerInternals.h
=====================================
@@ -14,7 +14,6 @@
 
 #if RTS_LINKER_USE_MMAP
 #include <sys/mman.h>
-void* mmap_next(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
 #endif
 
 void printLoadedObjects(void);


=====================================
testsuite/tests/driver/all.T
=====================================
@@ -121,7 +121,7 @@ else:
   only_darwin = skip
 
 test('static001', [extra_files(['Static001.hs']),
-                   only_darwin, expect_broken(8127)],
+                   only_darwin],
      makefile_test, ['static001'])
 
 test('dynHelloWorld',
@@ -261,7 +261,7 @@ test('T12955', normal, makefile_test, [])
 test('T12971', [when(opsys('mingw32'), expect_broken(17945)), ignore_stdout], makefile_test, [])
 test('json', normal, compile_fail, ['-ddump-json'])
 test('json2', normalise_version('base','ghc-prim'), compile, ['-ddump-types -ddump-json'])
-test('T16167', exit_code(1), run_command, 
+test('T16167', exit_code(1), run_command,
      ['{compiler} -x hs -e ":set prog T16167.hs" -ddump-json T16167.hs'])
 test('T13604', [], makefile_test, [])
 test('T13604a', [], makefile_test, [])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0f7df369abfd5b17fcde67a4aea11d425baafb65...cf91bf47c106074136b165a4c3e5db6f55f0554e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0f7df369abfd5b17fcde67a4aea11d425baafb65...cf91bf47c106074136b165a4c3e5db6f55f0554e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201027/a358ea1d/attachment-0001.html>


More information about the ghc-commits mailing list