From hpa at zytor.com Sun Feb 19 21:30:08 2023 From: hpa at zytor.com (nasm-bot for H. Peter Anvin) Date: Sun, 19 Feb 2023 21:30:08 -0800 Subject: [nasm:master] doc/changes.src: update to reflect current state Message-ID: Commit-ID: 8ce37daeea0e42c4e67a2a85d828e3a233249699 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=8ce37daeea0e42c4e67a2a85d828e3a233249699 Author: H. Peter Anvin AuthorDate: Sun, 19 Feb 2023 21:28:40 -0800 Committer: H. Peter Anvin CommitDate: Sun, 19 Feb 2023 21:28:49 -0800 doc/changes.src: update to reflect current state Signed-off-by: H. Peter Anvin --- doc/changes.src | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/changes.src b/doc/changes.src index 1e83d58f..05527bf2 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -7,6 +7,13 @@ The NASM 2 series supports x86-64, and is the production version of NASM since 2007. +\S{cl-2.16.02} Version 2.16.02 + +\b Fix building from the source distribution in a separate directory +from the source. + +\b Update broken \c{autoconf} macros. + \S{cl-2.16.01} Version 2.16.01 \e{This is a documentation update release only.} From hpa at zytor.com Sun Feb 19 21:30:07 2023 From: hpa at zytor.com (nasm-bot for H. Peter Anvin) Date: Sun, 19 Feb 2023 21:30:07 -0800 Subject: [nasm:master] autoconf: a much of macro fixes... not sure how this ever worked? Message-ID: Commit-ID: 5a2d629501d57301fe1d85fe6b2576e318f523d1 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=5a2d629501d57301fe1d85fe6b2576e318f523d1 Author: H. Peter Anvin AuthorDate: Sun, 19 Feb 2023 21:26:15 -0800 Committer: H. Peter Anvin CommitDate: Sun, 19 Feb 2023 21:26:15 -0800 autoconf: a much of macro fixes... not sure how this ever worked? Exposed a bunch of problems with the autoconf m4 macro library. Hopefulyy fix it, and tidy it up in the process. Signed-off-by: H. Peter Anvin --- .../m4/{pa_add_cflags.m4 => pa_add_cppflags.m4} | 4 +- autoconf/m4/pa_add_flags.m4 | 52 ++++++++++++++-------- autoconf/m4/pa_build_ifelse.m4 | 16 +++++++ autoconf/m4/pa_flags_langlist.m4 | 19 ++++++++ autoconf/m4/pa_lang_foreach.m4 | 15 +++++++ autoconf/m4/pa_lang_seen_list.m4 | 20 +++++++++ configure.ac | 45 ++++++++----------- 7 files changed, 124 insertions(+), 47 deletions(-) diff --git a/autoconf/m4/pa_add_cflags.m4 b/autoconf/m4/pa_add_cppflags.m4 similarity index 72% copy from autoconf/m4/pa_add_cflags.m4 copy to autoconf/m4/pa_add_cppflags.m4 index 26d55c4a..e5985f85 100644 --- a/autoconf/m4/pa_add_cflags.m4 +++ b/autoconf/m4/pa_add_cppflags.m4 @@ -1,9 +1,9 @@ dnl -------------------------------------------------------------------------- -dnl PA_ADD_CFLAGS(variable, flag [,actual_flag [,success [,failure]]]]) +dnl PA_ADD_CPPFLAGS(variable, flag [,actual_flag [,success [,failure]]]]) dnl dnl Attempt to add the given option to xFLAGS, if it doesn't break dnl compilation. If the option to be tested is different than the dnl option that should actually be added, add the option to be dnl actually added as a second argument. dnl -------------------------------------------------------------------------- -AC_DEFUN([PA_ADD_CFLAGS], [PA_ADD_FLAGS(CFLAGS, [$1], [$2], [$3], [$4])]) +AC_DEFUN([PA_ADD_CPPFLAGS], [PA_ADD_FLAGS(CPPFLAGS, [$1], [$2], [$3], [$4])]) diff --git a/autoconf/m4/pa_add_flags.m4 b/autoconf/m4/pa_add_flags.m4 index 06b0a77d..23f96f12 100644 --- a/autoconf/m4/pa_add_flags.m4 +++ b/autoconf/m4/pa_add_flags.m4 @@ -1,23 +1,39 @@ dnl -------------------------------------------------------------------------- -dnl PA_ADD_FLAGS(variable, flag [,actual_flag [,success [,failure]]]) +dnl PA_ADD_FLAGS(flagvar, flags) dnl -dnl Attempt to add the given option to CPPFLAGS, if it doesn't break -dnl compilation. If the option to be tested is different than the -dnl option that should actually be added, add the option to be -dnl actually added as a second argument. +dnl Add [flags] to the variable [flagvar] if and only if it is accepted +dnl by all languages affected by [flagvar], if those languages have +dnl been previously seen in the script. dnl -------------------------------------------------------------------------- AC_DEFUN([PA_ADD_FLAGS], -[AC_MSG_CHECKING([if $CC accepts $2]) - pa_add_flags__old_flags="$$1" - $1="$$1 $2" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], - [printf("Hello, World!\n");])], - [AC_MSG_RESULT([yes]) - $1="$pa_add_flags__old_flags ifelse([$3],[],[$2],[$3])" - AC_DEFINE(PA_SYM([$1_],[$2]), 1, - [Define to 1 if compiled with the `$2' compiler flag]) +[ + AS_VAR_PUSHDEF([old], [_$0_$1_orig]) + AS_VAR_PUSHDEF([ok], [_$0_$1_ok]) + AS_VAR_PUSHDEF([flags], [$1]) + + AS_VAR_COPY([old], [flags]) + AS_VAR_SET([flags], ["$flags $2"]) + AS_VAR_SET([ok], [yes]) + + PA_LANG_FOREACH(PA_FLAGS_LANGLIST($1), + [AS_VAR_IF([ok], [yes], + [AC_MSG_CHECKING([if $]_AC_CC[ accepts $2]) + PA_BUILD_IFELSE([], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AS_VAR_SET([ok], [no])])]) + ]) + + AS_VAR_IF([ok], [yes], + [m4_ifnblank([$3],[AS_VAR_SET([flags], ["$old $3"])]) + m4_foreach_w([_pa_add_flags_flag], [m4_ifblank([$3],[$2],[$3])], + [AC_DEFINE(PA_SYM([$1_]_pa_add_flags_flag), 1, + [Define to 1 if compiled with the ]_pa_add_flags_flag[ compiler flag])]) $4], - [AC_MSG_RESULT([no]) - $1="$pa_add_flags__old_flags" - $5])]) + [AS_VAR_SET([flags], ["$old"]) + $5]) + + AS_VAR_POPDEF([flags]) + AS_VAR_POPDEF([ok]) + AS_VAR_POPDEF([old]) +]) diff --git a/autoconf/m4/pa_build_ifelse.m4 b/autoconf/m4/pa_build_ifelse.m4 new file mode 100644 index 00000000..1aacfcd7 --- /dev/null +++ b/autoconf/m4/pa_build_ifelse.m4 @@ -0,0 +1,16 @@ +dnl -------------------------------------------------------------------------- +dnl PA_BUILD_IFELSE(input [,success [,failure]]) +dnl +dnl Same as AC_LINK_IFELSE for languages where linking is applicable, +dnl otherwise AC_COMPILE_IFELSE. +dnl +dnl If the first argument is empty, use _AC_LANG_IO_PROGRAM. +dnl -------------------------------------------------------------------------- +m4_defun([_PA_BUILD_IFELSE], +[m4_case(_AC_LANG, + [Erlang], [AC_COMPILE_IFELSE($@)], + [AC_LINK_IFELSE($@)])]) + +AC_DEFUN([PA_BUILD_IFELSE], +[_PA_BUILD_IFELSE([m4_ifblank([$1],[AC_LANG_SOURCE(_AC_LANG_IO_PROGRAM)], + [$1])],[$2],[$3])]) diff --git a/autoconf/m4/pa_flags_langlist.m4 b/autoconf/m4/pa_flags_langlist.m4 new file mode 100644 index 00000000..2ef5ded2 --- /dev/null +++ b/autoconf/m4/pa_flags_langlist.m4 @@ -0,0 +1,19 @@ +dnl -------------------------------------------------------------------------- +dnl PA_FLAGS_LANGLIST(flagvar) +dnl +dnl Return a list of languages affected by the variable flagvar. +dnl If flagvar is unknown, assume it affects the current language. +dnl -------------------------------------------------------------------------- +AC_DEFUN([PA_FLAGS_LANGLIST], +[m4_dquote(m4_case([$1], + [CPPFLAGS], [[C],[C++],[Objective C],[Objective C++]], + [CFLAGS], [[C]], + [CXXFLAGS], [[C++]], + [FFLAGS], [[Fortran 77]], + [FCFLAGS], [[Fortran]], + [ERLCFLAGS], [[Erlang]], + [OBJCFLAGS], [[Objective C]], + [OBJCXXFLAGS], [[Objective C++]], + [GOFLAGS], [[Go]], + [LDFLAGS], [[C],[C++],[Fortran 77],[Fortran],[Objective C],[Objective C++],[Go]], + m4_dquote(_AC_LANG)))]) diff --git a/autoconf/m4/pa_lang_foreach.m4 b/autoconf/m4/pa_lang_foreach.m4 new file mode 100644 index 00000000..650913d8 --- /dev/null +++ b/autoconf/m4/pa_lang_foreach.m4 @@ -0,0 +1,15 @@ +dnl -------------------------------------------------------------------------- +dnl PA_LANG_FOREACH(subset, body) +dnl +dnl Expand [body] for each language encountered in the configure script also +dnl present in [subset], or all if [subset] is empty +dnl -------------------------------------------------------------------------- +AC_DEFUN([_PA_LANG_DO],dnl +[AC_LANG([$2])dnl +$1]) + +AC_DEFUN([PA_LANG_FOREACH],dnl +[m4_pushdef([_pa_lang_foreach_current],[_AC_LANG])dnl +m4_map_args([m4_curry([_PA_LANG_DO],[$2])],m4_unquote(PA_LANG_SEEN_LIST($1)))dnl +AC_LANG(_pa_lang_foreach_current)dnl +m4_popdef([_pa_lang_foreach_current])]) diff --git a/autoconf/m4/pa_lang_seen_list.m4 b/autoconf/m4/pa_lang_seen_list.m4 new file mode 100644 index 00000000..d5240136 --- /dev/null +++ b/autoconf/m4/pa_lang_seen_list.m4 @@ -0,0 +1,20 @@ +dnl -------------------------------------------------------------------------- +dnl PA_LANG_SEEN_LIST(subset) +dnl +dnl List of the language lang has been used in the configuration +dnl script so far, possibly subset by [subset]. +dnl +dnl This relies on overriding _AC_LANG_SET(from, to), +dnl the internal implementation of _AC_LANG. +dnl -------------------------------------------------------------------------- +m4_ifndef([_PA_LANG_SET], +[m4_rename([_AC_LANG_SET], [_PA_LANG_SET])dnl +m4_defun([_AC_LANG_SET], [m4_set_add([_PA_LANG_SEEN_SET],[$2])dnl +_PA_LANG_SET($@)])]) + +AC_DEFUN([PA_LANG_SEEN_LIST], +[m4_set_delete([_pa_lang_seen_subset])dnl +m4_pushdef([_pa_lang_seen_subset_list],m4_ifnblank([$1],[$1],m4_dquote(m4_set_list([_PA_LANG_SEEN_SET]))))dnl +m4_set_add_all([_pa_lang_seen_subset],_pa_lang_seen_subset_list)dnl +m4_cdr(m4_set_intersection([_pa_lang_seen_subset],[_PA_LANG_SEEN_SET]))dnl +m4_popdef([_pa_lang_seen_subset_list])]) diff --git a/configure.ac b/configure.ac index 42cd1988..c8eec951 100644 --- a/configure.ac +++ b/configure.ac @@ -12,9 +12,6 @@ dnl start; this is used to generate config/unconfig.h. AH_BOTTOM([ /* Begin unconfig.h */]) -dnl Save initial CFLAGS, to see if -g -O2 came from configure or not -pa_init_cflags="$CFLAGS" - dnl This prevents us from running Wine and thinking we are not dnl cross-compiling when in fact we are; running Wine here is at dnl the best very slow and doesn't buy us a single thing at all. @@ -27,35 +24,29 @@ AC_CANONICAL_HOST dnl Enable any available C extensions AC_PROG_CC AC_USE_SYSTEM_EXTENSIONS -AC_SYS_LARGEFILE -PA_ADD_CFLAGS([-std=c17], [], [], -[PA_ADD_CFLAGS([-std=c11], [], [], - [PA_ADD_CFLAGS([-std=c99])])]) - -dnl If the user did not specify a CFLAGS default, change default -dnl to -O0 for debugging -PA_ARG_DISABLED([optimization], - [compile without optimization (-O0) to help debugging], - [pa_no_optimize=true]) +PA_ADD_CPPFLAGS([-std=c17], [], [], +[PA_ADD_CPPFLAGS([-std=c11], [], [], + [PA_ADD_CPPFLAGS([-std=c99])])]) -dnl Other programs -pa_no_optimize=false - -dnl Compile and link with dwarf debug +dnl Compile and link with gdb debug extensions PA_ARG_ENABLED([gdb], - [disable optimization and compile with extra debug information for GDB debugger], - [PA_ADD_CFLAGS([-ggdb3]) - pa_no_optimize=true]) + [compile with extra debug information for GDB debugger], + [PA_ADD_CFLAGS([-ggdb3])]) -AS_IF([$pa_no_optimize], - [PA_ADD_CFLAGS([-O0]) - PA_ADD_CFLAGS([-fno-omit-frame-pointer])]) +dnl Disable optimization +PA_ARG_DISABLED([optimization], + [compile without optimization (-O0) to help debugging], + [PA_ADD_CFLAGS([-O0]) + PA_ADD_CFLAGS([-fno-omit-frame-pointer])]) dnl Profiling PA_ARG_ENABLED([profiling], [compile with profiling (-pg option)], [PA_ADD_CFLAGS([-pg])]) +dnl Large files +AC_SYS_LARGEFILE + dnl Abort on panic PA_ARG_ENABLED([panic-abort], [call abort() on panic to trap in the debugger], @@ -104,10 +95,10 @@ AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_MKDIR_P -AC_CHECK_PROGS(NROFF, nroff, false) -AC_CHECK_PROGS(ASCIIDOC, asciidoc, false) -AC_CHECK_PROGS(XMLTO, xmlto, false) -AC_CHECK_PROGS(XZ, xz, false) +AC_CHECK_PROGS([NROFF], nroff, false) +AC_CHECK_PROGS([ASCIIDOC], asciidoc, false) +AC_CHECK_PROGS([XMLTO], xmlto, false) +AC_CHECK_PROGS([XZ], xz, false) dnl Check for progs needed for manpage generation MANPAGES=manpages From hpa at zytor.com Sun Feb 19 21:39:05 2023 From: hpa at zytor.com (nasm-bot for H. Peter Anvin) Date: Sun, 19 Feb 2023 21:39:05 -0800 Subject: [nasm:nasm-2.16.xx] autogen: add --cleanenv option and use it in the release script Message-ID: Commit-ID: ea49bac9b907c64f1d6595773bc7e7695b6e1de4 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=ea49bac9b907c64f1d6595773bc7e7695b6e1de4 Author: H. Peter Anvin AuthorDate: Sun, 19 Feb 2023 21:37:37 -0800 Committer: H. Peter Anvin CommitDate: Sun, 19 Feb 2023 21:37:37 -0800 autogen: add --cleanenv option and use it in the release script Make sure we don't pick up any local things from the environment. Signed-off-by: H. Peter Anvin --- autogen.sh | 18 ++++++++++++++---- tools/release | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/autogen.sh b/autogen.sh index f32c0c3f..d272abcb 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,10 +3,20 @@ # Run this script to regenerate autoconf files # recheck=false -if [ x"$1" = x--recheck ]; then - recheck=true - config=$(sh config.status --config 2>/dev/null) -fi +for arg; do + case x"$arg" in + x--recheck) + recheck=true + config=$(sh config.status --config 2>/dev/null) + ;; + x--clearenv) + unset AUTOCONF AUTOMAKE ACLOCAL AUTOHEADER ACLOCAL_PATH + ;; + *) + echo "$0: unknown option: $arg" 1>&2 + ;; + esac +done # This allows for overriding the default autoconf programs AUTOCONF="${AUTOCONF:-${AUTOTOOLS_PREFIX}autoconf}" diff --git a/tools/release b/tools/release index f353425a..c88cc36d 100755 --- a/tools/release +++ b/tools/release @@ -27,7 +27,7 @@ if [ x`cat version` != x"${version}" ]; then git update-index version git commit -m "Version ${version}" -- version fi -git tag -m "NASM version ${version}" -f "nasm-${version}" +git tag -m "NASM version ${version}" -f "nasm-${version}" cd "$WHERE" rm -rf nasm-release.* @@ -43,7 +43,7 @@ makej="${makej:-make}" # Create files which are in the release but automatically generated cd nasm -./autogen.sh +./autogen.sh --clearenv ./configure --prefix=/usr/local $makej perlreq spec manpages $makej alldeps From hpa at zytor.com Sun Feb 19 21:42:04 2023 From: hpa at zytor.com (nasm-bot for H. Peter Anvin) Date: Sun, 19 Feb 2023 21:42:04 -0800 Subject: [nasm:nasm-2.16.xx] NASM 2.16.02rc1 Message-ID: Commit-ID: b9528913aa7e8aa8a2ae93065d22bbd12fe7b4fd Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=b9528913aa7e8aa8a2ae93065d22bbd12fe7b4fd Author: H. Peter Anvin AuthorDate: Sun, 19 Feb 2023 21:39:16 -0800 Committer: H. Peter Anvin CommitDate: Sun, 19 Feb 2023 21:39:16 -0800 NASM 2.16.02rc1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index e8ecde2d..06ac1254 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.16.01 +2.16.02rc1