-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[gmp] Cleanup, fix cross-builds, switch windows from yasm to clang #27787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c01de3b
8665a77
d0620ae
724b06b
f39ea32
ddced27
a7d1996
d87c196
b37d2d9
634f652
e711714
8f90315
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| diff --git a/configure.ac b/configure.ac | ||
| index bd92bc4..bd2c0af 100644 | ||
| --- a/configure.ac | ||
| +++ b/configure.ac | ||
| @@ -3704,6 +3704,8 @@ if test "$gmp_asm_syntax_testing" != no; then | ||
| case $host in | ||
| *-*-darwin*) | ||
| GMP_INCLUDE_MPN(arm64/darwin.m4) ;; | ||
| + *-pc-mingw32) | ||
| + GMP_INCLUDE_MPN(arm64/coff.m4) ;; | ||
| *) | ||
| GMP_INCLUDE_MPN(arm64/arm64-defs.m4) ;; | ||
| esac | ||
| diff --git a/mpn/arm64/coff.m4 b/mpn/arm64/coff.m4 | ||
| new file mode 100644 | ||
| index 0000000..88605b3 | ||
| --- /dev/null | ||
| +++ b/mpn/arm64/coff.m4 | ||
| @@ -0,0 +1,54 @@ | ||
| +divert(-1) | ||
| + | ||
| +dnl m4 macros for ARM64 COFF assembler. | ||
| + | ||
| +dnl Copyright 2020 Free Software Foundation, Inc. | ||
| + | ||
| +dnl This file is part of the GNU MP Library. | ||
| +dnl | ||
| +dnl The GNU MP Library is free software; you can redistribute it and/or modify | ||
| +dnl it under the terms of either: | ||
| +dnl | ||
| +dnl * the GNU Lesser General Public License as published by the Free | ||
| +dnl Software Foundation; either version 3 of the License, or (at your | ||
| +dnl option) any later version. | ||
| +dnl | ||
| +dnl or | ||
| +dnl | ||
| +dnl * the GNU General Public License as published by the Free Software | ||
| +dnl Foundation; either version 2 of the License, or (at your option) any | ||
| +dnl later version. | ||
| +dnl | ||
| +dnl or both in parallel, as here. | ||
| +dnl | ||
| +dnl The GNU MP Library is distributed in the hope that it will be useful, but | ||
| +dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| +dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| +dnl for more details. | ||
| +dnl | ||
| +dnl You should have received copies of the GNU General Public License and the | ||
| +dnl GNU Lesser General Public License along with the GNU MP Library. If not, | ||
| +dnl see https://www.gnu.org/licenses/. | ||
| + | ||
| + | ||
| +dnl Standard commenting is with @, the default m4 # is for constants and we | ||
| +dnl don't want to disable macro expansions in or after them. | ||
| + | ||
| +changecom | ||
| + | ||
| + | ||
| +dnl LEA_HI(reg,gmp_symbol), LEA_LO(reg,gmp_symbol) | ||
| +dnl | ||
| +dnl Load the address of gmp_symbol into a register. We split this into two | ||
| +dnl parts to allow separation for manual insn scheduling. | ||
| + | ||
| +define(`LEA_HI', `ldr $1, =$2')dnl | ||
| +define(`LEA_LO')dnl | ||
| + | ||
| +dnl Usage: ALIGN(bytes) | ||
| +dnl | ||
| +dnl Emit a ".align" directive. | ||
| + | ||
| +define(`ALIGN', ` .align 8')dnl | ||
| + | ||
| +divert`'dnl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| diff --git a/Makefile.am b/Makefile.am | ||
| index 1c24694..9f92a4f 100644 | ||
| --- a/Makefile.am | ||
| +++ b/Makefile.am | ||
| @@ -1,3 +1,7 @@ | ||
| +# Using native tools, either this build or from host triplet | ||
| +HOST_TOOLS_PREFIX ?= . | ||
| +CC_FOR_BUILD = $(CC) $(CPPFLAGS) $(CFLAGS) | ||
| + | ||
| ## Process this file with automake to generate Makefile.in | ||
|
|
||
|
|
||
| @@ -344,8 +348,8 @@ install-data-hook: | ||
|
|
||
| EXTRA_DIST += bootstrap.c | ||
|
|
||
| -fac_table.h: gen-fac$(EXEEXT_FOR_BUILD) | ||
| - ./gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fac_table.h || (rm -f fac_table.h; exit 1) | ||
| +fac_table.h: $(HOST_TOOLS_PREFIX)/gen-fac$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-fac $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fac_table.h || (rm -f fac_table.h; exit 1) | ||
| BUILT_SOURCES += fac_table.h | ||
|
|
||
| gen-fac$(EXEEXT_FOR_BUILD): gen-fac$(U_FOR_BUILD).c bootstrap.c | ||
| @@ -354,12 +358,12 @@ DISTCLEANFILES += gen-fac$(EXEEXT_FOR_BUILD) | ||
| EXTRA_DIST += gen-fac.c | ||
|
|
||
|
|
||
| -fib_table.h: gen-fib$(EXEEXT_FOR_BUILD) | ||
| - ./gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1) | ||
| +fib_table.h: $(HOST_TOOLS_PREFIX)/gen-fib$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1) | ||
| BUILT_SOURCES += fib_table.h | ||
|
|
||
| -mpn/fib_table.c: gen-fib$(EXEEXT_FOR_BUILD) | ||
| - ./gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/fib_table.c || (rm -f mpn/fib_table.c; exit 1) | ||
| +mpn/fib_table.c: $(HOST_TOOLS_PREFIX)/gen-fib$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-fib table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/fib_table.c || (rm -f mpn/fib_table.c; exit 1) | ||
| BUILT_SOURCES += mpn/fib_table.c | ||
|
|
||
| gen-fib$(EXEEXT_FOR_BUILD): gen-fib$(U_FOR_BUILD).c bootstrap.c | ||
| @@ -368,12 +372,12 @@ DISTCLEANFILES += gen-fib$(EXEEXT_FOR_BUILD) | ||
| EXTRA_DIST += gen-fib.c | ||
|
|
||
|
|
||
| -mp_bases.h: gen-bases$(EXEEXT_FOR_BUILD) | ||
| - ./gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1) | ||
| +mp_bases.h: $(HOST_TOOLS_PREFIX)/gen-bases$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1) | ||
| BUILT_SOURCES += mp_bases.h | ||
|
|
||
| -mpn/mp_bases.c: gen-bases$(EXEEXT_FOR_BUILD) | ||
| - ./gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/mp_bases.c || (rm -f mpn/mp_bases.c; exit 1) | ||
| +mpn/mp_bases.c: $(HOST_TOOLS_PREFIX)/gen-bases$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-bases table $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/mp_bases.c || (rm -f mpn/mp_bases.c; exit 1) | ||
| BUILT_SOURCES += mpn/mp_bases.c | ||
|
|
||
| gen-bases$(EXEEXT_FOR_BUILD): gen-bases$(U_FOR_BUILD).c bootstrap.c | ||
| @@ -382,8 +386,8 @@ DISTCLEANFILES += gen-bases$(EXEEXT_FOR_BUILD) | ||
| EXTRA_DIST += gen-bases.c | ||
|
|
||
|
|
||
| -trialdivtab.h: gen-trialdivtab$(EXEEXT_FOR_BUILD) | ||
| - ./gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1) | ||
| +trialdivtab.h: $(HOST_TOOLS_PREFIX)/gen-trialdivtab$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1) | ||
| BUILT_SOURCES += trialdivtab.h | ||
|
|
||
| gen-trialdivtab$(EXEEXT_FOR_BUILD): gen-trialdivtab$(U_FOR_BUILD).c bootstrap.c | ||
| @@ -392,8 +396,8 @@ DISTCLEANFILES += gen-trialdivtab$(EXEEXT_FOR_BUILD) | ||
| EXTRA_DIST += gen-trialdivtab.c | ||
|
|
||
|
|
||
| -mpn/jacobitab.h: gen-jacobitab$(EXEEXT_FOR_BUILD) | ||
| - ./gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1) | ||
| +mpn/jacobitab.h: $(HOST_TOOLS_PREFIX)/gen-jacobitab$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1) | ||
| BUILT_SOURCES += mpn/jacobitab.h | ||
|
|
||
| gen-jacobitab$(EXEEXT_FOR_BUILD): gen-jacobitab$(U_FOR_BUILD).c | ||
| @@ -402,8 +406,8 @@ DISTCLEANFILES += gen-jacobitab$(EXEEXT_FOR_BUILD) | ||
| EXTRA_DIST += gen-jacobitab.c | ||
|
|
||
|
|
||
| -mpn/perfsqr.h: gen-psqr$(EXEEXT_FOR_BUILD) | ||
| - ./gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1) | ||
| +mpn/perfsqr.h: $(HOST_TOOLS_PREFIX)/gen-psqr$(EXEEXT_FOR_BUILD) | ||
| + $(HOST_TOOLS_PREFIX)/gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1) | ||
| BUILT_SOURCES += mpn/perfsqr.h | ||
|
|
||
| gen-psqr$(EXEEXT_FOR_BUILD): gen-psqr$(U_FOR_BUILD).c bootstrap.c | ||
| diff --git a/acinclude.m4 b/acinclude.m4 | ||
| index 86175ce..82b7ea1 100644 | ||
| --- a/acinclude.m4 | ||
| +++ b/acinclude.m4 | ||
| @@ -3833,6 +3833,7 @@ if AC_TRY_EVAL(gmp_compile); then | ||
| if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&AC_FD_CC 2>&1; then | ||
| cc_for_build_works=yes | ||
| fi | ||
| + cc_for_build_works=yes # forced | ||
| fi | ||
| rm -f conftest* a.out b.out a.exe a_out.exe | ||
| AC_MSG_RESULT($cc_for_build_works) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| diff --git a/configure.ac b/configure.ac | ||
| index cafdb3c71..bd92bc4bb 100644 | ||
| index cafdb3c..3c3e3c8 100644 | ||
| --- a/configure.ac | ||
| +++ b/configure.ac | ||
| @@ -2703,8 +2703,8 @@ Use "--disable-static --enable-shared" to build just a DLL.]) | ||
| @@ -2702,9 +2702,7 @@ Use "--disable-static --enable-shared" to build just a DLL.]) | ||
| # __isascii, but for some reason not the plain isascii. | ||
| # | ||
| if test "$enable_shared" = yes; then | ||
| GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" | ||
| - LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| - LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" | ||
| + #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" | ||
| + GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined" | ||
|
Comment on lines
8
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm does the symbol export still work without these ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked this with mingw-dynamic: The import libs are present and not empty, only smaller (in particular the C++ lib). |
||
| LIBGMP_DLL=1 | ||
| fi | ||
| ;; | ||
| diff --git a/gmp-h.in b/gmp-h.in | ||
| index 3d449d427..18a03b753 100644 | ||
| index 3d449d4..18a03b7 100644 | ||
| --- a/gmp-h.in | ||
| +++ b/gmp-h.in | ||
| @@ -398,7 +398,7 @@ typedef __mpq_struct *mpq_ptr; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
Makefile.inis generated fromMakefile.am.