lang/ghc: add armv6, armv7 and aarch64 to the list of supported architectures.
Corresponding PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196899
Differential D15674
lang/ghc: add armv6, armv7 and aarch64 to the list of supported architectures mikael on Jun 6 2018, 10:25 AM. Authored by Tags None Referenced Files
Details lang/ghc: add armv6, armv7 and aarch64 to the list of supported architectures. Corresponding PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196899 build and test on armv6, armv7 and aarch64 (real hw)
Diff Detail
Event Timeline
Comment Actions Hi! Thanks for this work, I'd love to see this merged soon. GHCi segfaults at launch on aarch64 (not a blocker — compiled mode working is good enough for now — but would be very very nice to have ghci working too): * thread #1, name = 'ghc', stop reason = signal SIGSEGV * frame #0: 0x000000004859a1a4 libHSrts_thr-ghc8.4.3.so`freeStablePtrUnsafe + 28 frame #1: 0x000000004859a1c4 libHSrts_thr-ghc8.4.3.so`freeStablePtr + 20 frame #2: 0x0000000048591e90 libHSrts_thr-ghc8.4.3.so`freeHaskellFunctionPtr + 16 frame #3: 0x0000000045d0fe44 libHSterminfo-0.4.1.1-ghc8.4.3.so frame #4: 0x00000000485b6ad0 libHSrts_thr-ghc8.4.3.so Also, please fix bsd.cabal.mk — with the patch as-is, shared libraries in cabal based ports don't get packaged! — it looks for x86_64-… shared libs. CABAL_ARCH should probably just be ${ARCH:S/amd64/x86_64/} instead of the x86-only hard-code that is there. Comment Actions It works here with ghc-8.4.2 (with gcc6, DYNAMIC and PROFILE options are "off") root@tegra-x1: ~ ghci GHCi, version 8.4.2: http://www.haskell.org/ghc/ :? for help Prelude> putStrLn "Hello World" Hello World Prelude> :load Main [1 of 1] Compiling Main ( Main.hs, interpreted ) Ok, one module loaded. *Main> fac 17 355687428096000 *Main>
I'm aware of the problem (see pr 196899 comment 5) but I'm not able to fix it :( Comment Actions
hm, I have gcc7 and these options ON. How to fix the arch —
I meant this: --- i/lang/ghc/bsd.cabal.mk +++ w/lang/ghc/bsd.cabal.mk @@ -54,10 +54,7 @@ GHC_LIB_DOCSDIR_REL= share/doc/ghc-${GHC_VERSION}/html/libraries CABAL_LIBDIR= ${PREFIX}/lib/cabal/ghc-${GHC_VERSION} CABAL_LIBSUBDIR= ${PACKAGE} -CABAL_ARCH= x86_64 -.if ("${ARCH}" == "i386") -CABAL_ARCH= i386 -.endif +CABAL_ARCH= ${ARCH:S/amd64/x86_64/} CABAL_ARCHSUBDIR= ${CABAL_ARCH}-freebsd-ghc-${GHC_VERSION} CABAL_LIBDIR_REL= ${CABAL_LIBDIR:S,^${PREFIX}/,,}
hmm :) please tell me more! Comment Actions (also additional replacements might be required for armv6/7 — I don't know how what ghc calls them, but e.g. if they're both just 'arm' you'd have something like ${ARCH:S/amd64/x86_64/:S/armv6/arm/:S/armv7/arm}) Comment Actions And now I'm seeing a segfault on armv7 due to the use of the wrong linker :/
Comment Actions With last raised points fixed this looks OK. Does it apply cleanly to HEAD?
Comment Actions Bad news. When building GHC with this patch applied on 12.0-CURRENT amd64, the ghc-iserv-prof executable gets broken. To reproduce run make -C /usr/ports/lang/ghc and then /usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.4.3/bin/ghc-iserv-prof. Backtrace doesn't ring a bell: (gdb) run Starting program: /wrkdirs/usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.4.3/bin/ghc-iserv-prof Program received signal SIGSEGV, Segmentation fault. digest_dynamic1 (obj=<optimized out>, early=0, dyn_rpath=<optimized out>, dyn_soname=<optimized out>, dyn_runpath=<optimized out>) at /usr/src/libexec/rtld-elf/rtld.c:1099 1099 obj->chain_zero_gnu = obj->buckets_gnu + obj->nbuckets_gnu - (gdb) bt #0 digest_dynamic1 (obj=<optimized out>, early=0, dyn_rpath=<optimized out>, dyn_soname=<optimized out>, dyn_runpath=<optimized out>) at /usr/src/libexec/rtld-elf/rtld.c:1099 #1 0x0000000801d3d4f6 in digest_dynamic (early=0, obj=<optimized out>) at /usr/src/libexec/rtld-elf/rtld.c:1348 #2 _rtld (sp=<optimized out>, exit_proc=0x7fffffffeaa0, objp=0x7fffffffeaa8) at /usr/src/libexec/rtld-elf/rtld.c:604 #3 0x0000000801d3c019 in .rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:39 #4 0x0000000000000000 in ?? () Comment Actions It also happens without my patch. fetch http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/ghc-8.4.3_1.txz mkdir /tmp/ghc tar xf ghc-8.4.3_1.txz -C /tmp/ghc /tmp/ghc/usr/local/lib/ghc-8.4.3/bin/ghc-iserv-prof Segmentation fault (core dumped) Exit 139 FWIW it works fine with gcc7: /usr/ports/lang/ghc/work/stage/usr/local/lib/ghc-8.4.3/bin/ghc-iserv-prof ghc-iserv-prof: usage: iserv <write-fd> <read-fd> [-v] Comment Actions Hum, right. Then it shouldn't block this diff. But it is a strange bug, because stage-qa fails sometimes due to this broken executable, and sometimes it passes. Very well, if you've verified that with your patch everything's working on ARM, I'm OK with this. I will reword IGNORE message for QEMU_EMULATING case and commit this after getting @tcberner or @AMDmi3 approval. Comment Actions Very good -- thanks for working on this :) @arrowd once you have the bootstrap tarball uploaded it looks good to me (obviously, I did not verify the arm-build :)) -- remember to change the comment.
Comment Actions Thanks for this! Have the autoconf patches made it upstream, out of curiosity?
|