[Git][ghc/ghc][wip/rts-configure-new-cabal] Get newer Cabal for Hadrian, use for `findPtr`

John Ericson (@Ericson2314) gitlab at gitlab.haskell.org
Fri Jan 20 17:23:03 UTC 2023



John Ericson pushed to branch wip/rts-configure-new-cabal at Glasgow Haskell Compiler / GHC


Commits:
4c349ee5 by John Ericson at 2023-01-20T11:21:17-05:00
Get newer Cabal for Hadrian, use for `findPtr`

There are many more things we would use this for, this is just a first
simple example to ensure the Cabal bump is working as intended.

- - - - -


6 changed files:

- hadrian/cabal.project
- hadrian/hadrian.cabal
- hadrian/stack.yaml
- rts/configure.ac
- rts/external-symbols.list.in
- rts/rts.cabal.in


Changes:

=====================================
hadrian/cabal.project
=====================================
@@ -1,4 +1,6 @@
 packages: ./
+-- N.B. This could be removed once Cabal 3.9 is released.
+packages: ../libraries/Cabal/Cabal, ../libraries/Cabal/Cabal-syntax
 
 -- This essentially freezes the build plan for hadrian
 index-state: 2022-11-19T22:13:06Z


=====================================
hadrian/hadrian.cabal
=====================================
@@ -149,7 +149,7 @@ executable hadrian
                        , TypeOperators
     other-extensions:    MultiParamTypeClasses
                        , TypeFamilies
-    build-depends:       Cabal                >= 3.2     && < 3.9
+    build-depends:       Cabal                >= 3.9     && < 3.10
                        , base                 >= 4.11    && < 5
                        , bytestring           >= 0.10    && < 0.12
                        , containers           >= 0.5     && < 0.7


=====================================
hadrian/stack.yaml
=====================================
@@ -2,6 +2,8 @@ resolver: lts-19.8
 
 packages:
 - '.'
+- '../libraries/Cabal/Cabal'
+- '../libraries/Cabal/Cabal-syntax'
 
 nix:
    enable: false


=====================================
rts/configure.ac
=====================================
@@ -62,8 +62,14 @@ dnl ######################################################################
 
 dnl See Note [Undefined symbols in the RTS]
 
+[
+symbolExtraDefs=''
+if [[ $CABAL_FLAG_find_ptr = 1 ]]; then
+    symbolExtraDefs+=' -DFIND_PTR'
+fi
+
 cat $srcdir/external-symbols.list.in \
-    | "$CC" -E -P -traditional -Iinclude - -o - \
+    | "$CC" $symbolExtraDefs -E -P -traditional -Iinclude - -o - \
     | sed '/^$/d' \
     > external-symbols.list \
     || exit 1
@@ -75,14 +81,17 @@ else
     sed 's/^/  -Wl,-u,/' external-symbols.tmp > external-symbols.list
 fi
 rm -f external-symbols.tmp
+]
 
 dnl ######################################################################
 dnl Generate build-info
 dnl ######################################################################
 
+[
 cat $srcdir/rts.buildinfo.in | \
     sed -e 's/^  *//' | \
     "$CC" -E -P -traditional - -o - \
     > rts.buildinfo
 echo "" >> rts.buildinfo
 rm -f external-symbols.list
+]


=====================================
rts/external-symbols.list.in
=====================================
@@ -19,6 +19,10 @@ hs_atomicwrite64
 base_GHCziEventziWindows_processRemoteCompletion_closure
 #endif
 
+#if FIND_PTR
+findPtr
+#endif
+
 base_GHCziTopHandler_runIO_closure
 base_GHCziTopHandler_runNonIO_closure
 ghczmprim_GHCziTupleziPrim_Z0T_closure


=====================================
rts/rts.cabal.in
=====================================
@@ -295,23 +295,6 @@ library
                         stg/Ticky.h
                         stg/Types.h
 
-      -- See Note [Undefined symbols in the RTS]
-      --
-      -- We should handle this symbol with the others in the configure script
-      -- once we are using Cabal containing
-      -- https://github.com/haskell/cabal/pull/8565 /
-      -- 30f8a46008d164b5c4c6ce0b4453eb93eb5ef46c.
-      if flag(leading-underscore)
-        if flag(find-ptr)
-          -- This symbol is useful in gdb, but not referred to anywhere,
-          -- so we need to force it to be included in the binary.
-          ld-options: "-Wl,-u,_findPtr"
-      else
-        if flag(find-ptr)
-          -- This symbol is useful in gdb, but not referred to anywhere,
-          -- so we need to force it to be included in the binary.
-          ld-options: "-Wl,-u,findPtr"
-
       if os(osx)
         ld-options: "-Wl,-search_paths_first"
                     -- See Note [fd_set_overflow]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c349ee56a0ae1cdc32adc6ac9c4f86a1eb003da

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4c349ee56a0ae1cdc32adc6ac9c4f86a1eb003da
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/20230120/690d4df7/attachment-0001.html>


More information about the ghc-commits mailing list