[Git][ghc/ghc][ghc-8.6] 3 commits: gitlab-ci: Build hyperlinked sources for releases

Ben Gamari gitlab at gitlab.haskell.org
Sat Apr 6 13:49:07 UTC 2019



Ben Gamari pushed to branch ghc-8.6 at Glasgow Haskell Compiler / GHC


Commits:
e04e3d81 by Ben Gamari at 2019-04-04T16:35:47Z
gitlab-ci: Build hyperlinked sources for releases

Fixes #16445.

(cherry picked from commit a32ac2f4d963b657c0a53359b492c593e82304b1)

- - - - -
9cf1f91b by klebinger.andreas at gmx.at at 2019-04-04T16:35:47Z
Restore Xmm registers properly in StgCRun.c

This fixes #16514: Xmm6-15 was restored based off rax instead of rsp.
The code was introduced in the fix for #14619.

(cherry picked from commit 9b131500371a07626e33edc56700c12322364560)

- - - - -
d2a284ab by Ben Gamari at 2019-04-04T16:35:47Z
configure: Always use AC_LINK_ELSEIF when testing against assembler

This fixes #16440, where the build system incorrectly concluded that the
`.subsections_via_symbols` assembler directive was supported on a Linux
system. This was caused by the fact that gcc was invoked with `-flto`;
when so-configured gcc does not call the assembler but rather simply
serialises its AST for compilation during the final link.

This is described in Note [autoconf assembler checks and -flto].

(cherry picked from commit 7b090b53fea065d2cfd967ea919426af9ba8d737)

- - - - -


3 changed files:

- .gitlab-ci.yml
- aclocal.m4
- rts/StgCRun.c


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -152,6 +152,12 @@ validate-x86_64-darwin:
     - git submodule sync --recursive
     - git submodule update --init --recursive
     - git checkout .gitmodules
+    - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
+      # Build hyperlinked sources for documentation when building releases
+    - |
+      if [[ -n "$CI_COMMIT_TAG" ]]; then
+        echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
+      fi
 
     - bash .circleci/prepare-system.sh
     # workaround for docker permissions


=====================================
aclocal.m4
=====================================
@@ -288,11 +288,31 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         esac
     }
 
+    dnl Note [autoconf assembler checks and -flto]
+    dnl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    dnl
+    dnl Autoconf's AC_COMPILE_IFELSE macro is fragile in the case of checks
+    dnl which require that the assembler is run. Specifically, GCC does not run
+    dnl the assembler if invoked with `-c -flto`; it merely dumps its internal
+    dnl AST to the object file, to be compiled and assembled during the final
+    dnl link.
+    dnl
+    dnl This can cause configure checks like that for the
+    dnl .subsections_via_symbols directive to pass unexpected (see #16440),
+    dnl leading the build system to incorrectly conclude that the directive is
+    dnl supported.
+    dnl
+    dnl For this reason, it is important that configure checks that rely on the
+    dnl assembler failing use AC_LINK_IFELSE rather than AC_COMPILE_IFELSE,
+    dnl ensuring that the assembler sees the check.
+    dnl
+
     dnl ** check for Apple-style dead-stripping support
     dnl    (.subsections-via-symbols assembler directive)
 
     AC_MSG_CHECKING(for .subsections_via_symbols)
-    AC_COMPILE_IFELSE(
+    dnl See Note [autoconf assembler checks and -flto]
+    AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([], [__asm__ (".subsections_via_symbols");])],
         [AC_MSG_RESULT(yes)
          HaskellHaveSubsectionsViaSymbols=True
@@ -305,8 +325,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
     dnl ** check for .ident assembler directive
 
     AC_MSG_CHECKING(whether your assembler supports .ident directive)
-    AC_COMPILE_IFELSE(
-        [AC_LANG_SOURCE([__asm__ (".ident \"GHC x.y.z\"");])],
+    dnl See Note [autoconf assembler checks and -flto]
+    AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([__asm__ (".ident \"GHC x.y.z\"");], [])],
         [AC_MSG_RESULT(yes)
          HaskellHaveIdentDirective=True],
         [AC_MSG_RESULT(no)
@@ -330,8 +351,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
         ;;
     esac
     AC_MSG_CHECKING(for GNU non-executable stack support)
-    AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM([__asm__ (".section .note.GNU-stack,\"\",$progbits");], [0])],
+    dnl See Note [autoconf assembler checks and -flto]
+    AC_LINK_IFELSE(
+       dnl the `main` function is placed after the .note.GNU-stack directive
+       dnl so we need to ensure that the active segment is correctly set,
+       dnl otherwise `main` will be placed in the wrong segment.
+        [AC_LANG_PROGRAM([
+           __asm__ (".section .note.GNU-stack,\"\",$progbits");
+           __asm__ (".section .text");
+         ], [0])],
         [AC_MSG_RESULT(yes)
          HaskellHaveGnuNonexecStack=True],
         [AC_MSG_RESULT(no)


=====================================
rts/StgCRun.c
=====================================
@@ -489,15 +489,15 @@ StgRunIsImplementedInAssembler(void)
         "movq  48(%%rsp),%%rdi\n\t"
         "movq  56(%%rsp),%%rsi\n\t"
         "movq  64(%%rsp),%%xmm6\n\t"
-        "movq  72(%%rax),%%xmm7\n\t"
-        "movq  80(%%rax),%%xmm8\n\t"
-        "movq  88(%%rax),%%xmm9\n\t"
-        "movq  96(%%rax),%%xmm10\n\t"
-        "movq 104(%%rax),%%xmm11\n\t"
-        "movq 112(%%rax),%%xmm12\n\t"
-        "movq 120(%%rax),%%xmm13\n\t"
-        "movq 128(%%rax),%%xmm14\n\t"
-        "movq 136(%%rax),%%xmm15\n\t"
+        "movq  72(%%rsp),%%xmm7\n\t"
+        "movq  80(%%rsp),%%xmm8\n\t"
+        "movq  88(%%rsp),%%xmm9\n\t"
+        "movq  96(%%rsp),%%xmm10\n\t"
+        "movq 104(%%rsp),%%xmm11\n\t"
+        "movq 112(%%rsp),%%xmm12\n\t"
+        "movq 120(%%rsp),%%xmm13\n\t"
+        "movq 128(%%rsp),%%xmm14\n\t"
+        "movq 136(%%rsp),%%xmm15\n\t"
 #endif
         "addq %1, %%rsp\n\t"
         "retq"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/97c1ef86decbf633c58804125ef46f69e84119d9...d2a284ab461681919cadaed394adebe42c4cc7bb

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/97c1ef86decbf633c58804125ef46f69e84119d9...d2a284ab461681919cadaed394adebe42c4cc7bb
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/20190406/ff7f7a70/attachment-0001.html>


More information about the ghc-commits mailing list