Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src tests/libexec/ld.elf_so: Fix helper library makefiles.



details:   https://anonhg.NetBSD.org/src/rev/273276b2f3cb
branches:  trunk
changeset: 377300:273276b2f3cb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 05 22:42:46 2023 +0000

description:
tests/libexec/ld.elf_so: Fix helper library makefiles.

1. Consolidate logic into a single helper.mk to reduce duplication.
2. Set NO* variables, not MK* variables which are reserved for user.
3. Avoid eager X!= in favour of lazy ${X:sh}.
4. Mark _g.a set list entries obsolete.  Never should've been built!

PR misc/57462

diffstat:

 distrib/sets/lists/debug/mi                              |  22 +++++++-------
 distrib/sets/lists/debug/shl.mi                          |  16 +++++-----
 tests/libexec/ld.elf_so/helper.mk                        |  18 ++++++++++++
 tests/libexec/ld.elf_so/helper_abuse_dynamic/Makefile    |  20 ++----------
 tests/libexec/ld.elf_so/helper_abuse_static/Makefile     |  20 ++----------
 tests/libexec/ld.elf_so/helper_def_dynamic/Makefile      |  17 +----------
 tests/libexec/ld.elf_so/helper_def_static/Makefile       |  17 +----------
 tests/libexec/ld.elf_so/helper_dso1/Makefile             |  21 ++-----------
 tests/libexec/ld.elf_so/helper_dso2/Makefile             |  24 ++++------------
 tests/libexec/ld.elf_so/helper_dso3/Makefile             |  23 +++------------
 tests/libexec/ld.elf_so/helper_ifunc_dso/Makefile        |  21 ++-----------
 tests/libexec/ld.elf_so/helper_onlyctor_dynamic/Makefile |  20 ++----------
 tests/libexec/ld.elf_so/helper_onlydef/Makefile          |  17 +----------
 tests/libexec/ld.elf_so/helper_onlydef_static/Makefile   |  17 +----------
 tests/libexec/ld.elf_so/helper_onlyuse_dynamic/Makefile  |  20 ++----------
 tests/libexec/ld.elf_so/helper_onlyuse_static/Makefile   |  20 ++----------
 tests/libexec/ld.elf_so/helper_symver_dso0/Makefile      |  13 +-------
 tests/libexec/ld.elf_so/helper_symver_dso1/Makefile      |  13 +-------
 tests/libexec/ld.elf_so/helper_symver_dso2/Makefile      |  13 +-------
 tests/libexec/ld.elf_so/helper_use_dynamic/Makefile      |  20 ++----------
 tests/libexec/ld.elf_so/helper_use_static/Makefile       |  20 ++----------
 21 files changed, 98 insertions(+), 294 deletions(-)

diffs (truncated from 593 to 300 lines):

diff -r 85462f287c08 -r 273276b2f3cb distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi       Wed Jul 05 22:13:20 2023 +0000
+++ b/distrib/sets/lists/debug/mi       Wed Jul 05 22:42:46 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.405 2023/06/21 02:48:49 pgoyette Exp $
+# $NetBSD: mi,v 1.406 2023/07/05 22:42:46 riastradh Exp $
 ./etc/mtree/set.debug                           comp-sys-root
 ./usr/lib                                      comp-sys-usr            compatdir
 ./usr/lib/i18n/libBIG5_g.a                     comp-c-debuglib         debuglib,compatfile
@@ -2532,14 +2532,14 @@
 ./usr/libdata/debug/usr/tests/util/id/h_id.debug                       tests-obsolete          obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug      tests-obsolete          obsolete,compattestfile
 ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a  comp-c-debuglib         atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_abuse_dynamic_g.a                   tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_abuse_static_g.a                    tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_def_dynamic_g.a                     tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_def_static_g.a                      tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_onlyctor_dynamic_g.a                        tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_onlydef_g.a                         tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_onlyuse_dynamic_g.a                 tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_onlyuse_static_g.a                  tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_use_dynamic_g.a                     tests-libexec-debug     debuglib,atf,pic,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_use_static_g.a                      tests-libexec-debug     debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_abuse_dynamic_g.a                   tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_abuse_static_g.a                    tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_def_dynamic_g.a                     tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_def_static_g.a                      tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_onlyctor_dynamic_g.a                        tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_onlydef_g.a                         tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_onlyuse_dynamic_g.a                 tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_onlyuse_static_g.a                  tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_use_dynamic_g.a                     tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
+./usr/tests/libexec/ld.elf_so/libh_use_static_g.a                      tests-obsolete  obsolete,debuglib,atf,pic,compattestfile
 ./var/db/obsolete/debug                                base-sys-root           debug
diff -r 85462f287c08 -r 273276b2f3cb distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi   Wed Jul 05 22:13:20 2023 +0000
+++ b/distrib/sets/lists/debug/shl.mi   Wed Jul 05 22:42:46 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.313 2023/07/04 16:22:10 riastradh Exp $
+# $NetBSD: shl.mi,v 1.314 2023/07/05 22:42:46 riastradh Exp $
 ./usr/lib/libbfd_g.a                                           comp-c-debuglib debuglib,compatfile,binutils
 ./usr/libdata/debug/lib                                                base-sys-usr    debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug                    comp-zfs-debug  debug,dynamicroot,zfs
@@ -377,10 +377,10 @@
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/libh_onlyuse_static.so.1.debug tests-libexec-debug     debug,compattestfile,atf
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/libh_use_dynamic.so.1.debug    tests-libexec-debug     debug,compattestfile,atf
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/libh_use_static.so.1.debug     tests-libexec-debug     debug,compattestfile,atf
-./usr/tests/libexec/ld.elf_so/h_helper_symver_dso0/libh_helper_symver_dso_g.a  comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/h_helper_symver_dso1/libh_helper_symver_dso_g.a  comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/h_helper_symver_dso2/libh_helper_symver_dso_g.a  comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_helper_dso1_g.a                     comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_helper_dso2_g.a                     comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_helper_dso3_g.a                     comp-c-debuglib atf,debuglib,compattestfile
-./usr/tests/libexec/ld.elf_so/libh_helper_ifunc_dso_g.a                        comp-c-debuglib atf,debuglib,compattestfile
+./usr/tests/libexec/ld.elf_so/h_helper_symver_dso0/libh_helper_symver_dso_g.a  comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/h_helper_symver_dso1/libh_helper_symver_dso_g.a  comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/h_helper_symver_dso2/libh_helper_symver_dso_g.a  comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/libh_helper_dso1_g.a                     comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/libh_helper_dso2_g.a                     comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/libh_helper_dso3_g.a                     comp-obsolete   atf,debuglib,compattestfile,obsolete
+./usr/tests/libexec/ld.elf_so/libh_helper_ifunc_dso_g.a                        comp-obsolete   atf,debuglib,compattestfile,obsolete
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/libexec/ld.elf_so/helper.mk Wed Jul 05 22:42:46 2023 +0000
@@ -0,0 +1,18 @@
+#      $NetBSD: helper.mk,v 1.1 2023/07/05 22:42:46 riastradh Exp $
+
+# Makefile fragment for building a helper library used by ld.elf_so
+# tests.  All we need to install is lib${LIB}.so and lib${LIB}.so.1.
+# No man page, no lint library, no static libraries of any sort.
+
+LIBDIR?=       ${TESTSBASE}/libexec/ld.elf_so
+SHLIBDIR?=     ${TESTSBASE}/libexec/ld.elf_so
+SHLIB_MAJOR?=  1
+
+NODEBUGLIB=    # defined
+NOLINT=                # defined
+NOMAN=         # defined
+NOPICINSTALL=  # defined
+NOPROFILE=     # defined
+NOSTATICLIB=   # defined
+
+.include <bsd.lib.mk>
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_abuse_dynamic/Makefile
--- a/tests/libexec/ld.elf_so/helper_abuse_dynamic/Makefile     Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_abuse_dynamic/Makefile     Wed Jul 05 22:42:46 2023 +0000
@@ -1,22 +1,10 @@
-#      $NetBSD: Makefile,v 1.1 2023/06/01 22:26:40 riastradh Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.2 2023/07/05 22:42:46 riastradh Exp $
 
 LIB=           h_abuse_dynamic
 SRCS=          h_abuse_dynamic.c
 
-DEF_DIR!=      cd ${.CURDIR}/../helper_def_dynamic && ${PRINTOBJDIR}
+DEF_DIR_cmd=   cd ${.CURDIR}/../helper_def_dynamic && ${PRINTOBJDIR}
+DEF_DIR=       ${DEF_DIR_cmd:sh}
 LDADD+=                -Wl,-rpath,${TESTSDIR} -L${DEF_DIR} -lh_def_dynamic
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_abuse_static/Makefile
--- a/tests/libexec/ld.elf_so/helper_abuse_static/Makefile      Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_abuse_static/Makefile      Wed Jul 05 22:42:46 2023 +0000
@@ -1,22 +1,10 @@
-#      $NetBSD: Makefile,v 1.1 2023/06/01 22:26:40 riastradh Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.2 2023/07/05 22:42:46 riastradh Exp $
 
 LIB=           h_abuse_static
 SRCS=          h_abuse_static.c
 
-DEF_DIR!=      cd ${.CURDIR}/../helper_def_static && ${PRINTOBJDIR}
+DEF_DIR_cmd=   cd ${.CURDIR}/../helper_def_static && ${PRINTOBJDIR}
+DEF_DIR=       ${DEF_DIR_cmd:sh}
 LDADD+=                -Wl,-rpath,${TESTSDIR} -L${DEF_DIR} -lh_def_static
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_def_dynamic/Makefile
--- a/tests/libexec/ld.elf_so/helper_def_dynamic/Makefile       Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_def_dynamic/Makefile       Wed Jul 05 22:42:46 2023 +0000
@@ -1,19 +1,6 @@
-#      $NetBSD: Makefile,v 1.1 2023/06/01 20:50:18 riastradh Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.2 2023/07/05 22:42:46 riastradh Exp $
 
 LIB=           h_def_dynamic
 SRCS=          h_def_dynamic.c
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_def_static/Makefile
--- a/tests/libexec/ld.elf_so/helper_def_static/Makefile        Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_def_static/Makefile        Wed Jul 05 22:42:46 2023 +0000
@@ -1,19 +1,6 @@
-#      $NetBSD: Makefile,v 1.1 2023/05/31 00:18:44 riastradh Exp $
-
-.include <bsd.own.mk>
+#      $NetBSD: Makefile,v 1.2 2023/07/05 22:42:46 riastradh Exp $
 
 LIB=           h_def_static
 SRCS=          h_def_static.c
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_dso1/Makefile
--- a/tests/libexec/ld.elf_so/helper_dso1/Makefile      Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_dso1/Makefile      Wed Jul 05 22:42:46 2023 +0000
@@ -1,19 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2011/03/31 23:34:48 joerg Exp $
-
-.include <bsd.own.mk>
-
-LIB=                   h_helper_dso1
-SRCS=                  h_helper_dso1.c
+# $NetBSD: Makefile,v 1.2 2023/07/05 22:42:46 riastradh Exp $
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
+LIB=           h_helper_dso1
+SRCS=          h_helper_dso1.c
 
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_dso2/Makefile
--- a/tests/libexec/ld.elf_so/helper_dso2/Makefile      Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_dso2/Makefile      Wed Jul 05 22:42:46 2023 +0000
@@ -1,22 +1,10 @@
-# $NetBSD: Makefile,v 1.1 2011/03/31 23:34:48 joerg Exp $
-
-.include <bsd.own.mk>
+# $NetBSD: Makefile,v 1.2 2023/07/05 22:42:47 riastradh Exp $
 
-LIB=                   h_helper_dso2
-SRCS=                  h_helper_dso2.c
+LIB=           h_helper_dso2
+SRCS=          h_helper_dso2.c
 
-DSO1DIR!=      cd ${.CURDIR}/../helper_dso1 && ${PRINTOBJDIR}
+DSO1DIR_cmd=   cd ${.CURDIR}/../helper_dso1 && ${PRINTOBJDIR}
+DSO1DIR=       ${DSO1DIR_cmd:sh}
 LDADD+=                -Wl,-rpath,${TESTSDIR} -L${DSO1DIR} -lh_helper_dso1
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
-
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_dso3/Makefile
--- a/tests/libexec/ld.elf_so/helper_dso3/Makefile      Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_dso3/Makefile      Wed Jul 05 22:42:46 2023 +0000
@@ -1,22 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2017/07/11 15:21:36 joerg Exp $
-
-.include <bsd.own.mk>
-
-LIB=                   h_helper_dso3
-LIBISCXX=      yes
-SRCS=                  h_helper_dso3.cpp
+# $NetBSD: Makefile,v 1.2 2023/07/05 22:42:47 riastradh Exp $
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
-
-MKSTATICLIB=   no
-MKPROFILE=     no
-MKPICINSTALL=  no
-MKLINT=                no
-
-NOMAN=         # defined
+LIB=           h_helper_dso3
+LIBISCXX=      yes
+SRCS=          h_helper_dso3.cpp
 
 CXXFLAGS+=     -std=c++11
 
-.include <bsd.lib.mk>
+.include "../helper.mk"
diff -r 85462f287c08 -r 273276b2f3cb tests/libexec/ld.elf_so/helper_ifunc_dso/Makefile
--- a/tests/libexec/ld.elf_so/helper_ifunc_dso/Makefile Wed Jul 05 22:13:20 2023 +0000
+++ b/tests/libexec/ld.elf_so/helper_ifunc_dso/Makefile Wed Jul 05 22:42:46 2023 +0000
@@ -1,19 +1,6 @@
-# $NetBSD: Makefile,v 1.1 2014/08/25 20:40:53 joerg Exp $
-
-.include <bsd.own.mk>
-
-LIB=                   h_helper_ifunc_dso
-SRCS=                  h_helper_ifunc.c
+# $NetBSD: Makefile,v 1.2 2023/07/05 22:42:47 riastradh Exp $
 
-LIBDIR=                ${TESTSBASE}/libexec/ld.elf_so
-SHLIBDIR=      ${TESTSBASE}/libexec/ld.elf_so
-SHLIB_MAJOR=   1
+LIB=           h_helper_ifunc_dso
+SRCS=          h_helper_ifunc.c



Home | Main Index | Thread Index | Old Index