Repository: spack/spack

Issue:
Installation issue: linux-pam
### Steps to reproduce the issue

```console
$ spack spec -I linux-pam
Input spec
--------------------------------
 -   linux-pam

Concretized
--------------------------------
 -   linux-pam@1.5.2%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]      ^autoconf@2.72%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]          ^perl@5.38.2%gcc@14.1.0+cpanm+opcode+open+shared+threads build_system=generic arch=linux-pop22-zen3
[+]              ^berkeley-db@18.1.40%gcc@14.1.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-pop22-zen3
[+]              ^bzip2@1.0.8%gcc@14.1.0~debug~pic+shared build_system=generic arch=linux-pop22-zen3
[+]              ^gdbm@1.23%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]                  ^readline@8.2%gcc@14.1.0 build_system=autotools patches=bbf97f1 arch=linux-pop22-zen3
[+]              ^zlib@1.3.1%gcc@14.1.0+optimize+pic+shared build_system=makefile arch=linux-pop22-zen3
[+]      ^automake@1.16.5%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]      ^gcc-runtime@14.1.0%gcc@14.1.0 build_system=generic arch=linux-pop22-zen3
[e]      ^glibc@2.35%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]      ^gmake@4.4.1%gcc@14.1.0~guile build_system=generic arch=linux-pop22-zen3
[+]      ^libtirpc@1.3.3%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]          ^krb5@1.21.2%gcc@14.1.0+shared build_system=autotools arch=linux-pop22-zen3
[+]              ^bison@3.8.2%gcc@14.1.0~color build_system=autotools arch=linux-pop22-zen3
[+]              ^gettext@0.22.5%gcc@14.1.0+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=linux-pop22-zen3
[+]                  ^libxml2@2.10.3%gcc@14.1.0+pic~python+shared build_system=autotools arch=linux-pop22-zen3
[+]                      ^pkgconf@2.2.0%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]                  ^ncurses@6.5%gcc@14.1.0~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-pop22-zen3
[+]                  ^tar@1.34%gcc@14.1.0 build_system=autotools zip=pigz arch=linux-pop22-zen3
[+]                      ^pigz@2.8%gcc@14.1.0 build_system=makefile arch=linux-pop22-zen3
[+]                      ^zstd@1.5.6%gcc@14.1.0+programs build_system=makefile compression=none libs=shared,static arch=linux-pop22-zen3
[+]                  ^xz@5.4.6%gcc@14.1.0~pic build_system=autotools libs=shared,static arch=linux-pop22-zen3
[+]              ^openssl@3.3.0%gcc@14.1.0~docs+shared build_system=generic certs=mozilla arch=linux-pop22-zen3
[+]                  ^ca-certificates-mozilla@2023-05-30%gcc@14.1.0 build_system=generic arch=linux-pop22-zen3
[+]      ^libtool@2.4.7%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]          ^findutils@4.9.0%gcc@14.1.0 build_system=autotools patches=440b954 arch=linux-pop22-zen3
[+]      ^m4@1.4.19%gcc@14.1.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-pop22-zen3
[+]          ^diffutils@3.10%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
[+]              ^libiconv@1.17%gcc@14.1.0 build_system=autotools libs=shared,static arch=linux-pop22-zen3
[+]          ^libsigsegv@2.14%gcc@14.1.0 build_system=autotools arch=linux-pop22-zen3
```


### Error message

<details><summary>Error message</summary>

<pre>
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16' 'V=1'

10 errors found in build log:
     485    mv -f .deps/pam_modutil_priv.Tpo .deps/pam_modutil_priv.Plo
     486    mv -f .deps/pam_modutil_sanitize.Tpo .deps/pam_modutil_sanitize.Plo
     487    mv -f .deps/pam_modutil_searchkey.Tpo .deps/pam_modutil_searchkey.Plo
     488    /bin/bash ../libtool  --tag=CC   --mode=link /home/teague/System/apps/spack/lib/spack/env/gcc/gcc -D
            DEFAULT_MODULE_PATH=\"/home/teague/System/apps/spack/opt/spack/linux-pop22-zen3/gcc-14.1.0/linux-pam
            -1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/lib/security/\" -DLIBPAM_COMPILE -I./include   -DPAM_VERSION
            =\"1.5.2\" -DSYSCONFDIR=\"/home/teague/System/apps/spack/opt/spack/linux-pop22-zen3/gcc-14.1.0/linux
            -pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/etc\" -W -Wall -Wbad-function-cast -Wcast-align -Wcast-a
            lign=strict -Wcast-qual -Wdeprecated -Winline -Wmain -Wmissing-declarations -Wmissing-format-attribu
            te -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wshadow -Wstrict-prototypes -Wuninitialized -
            Wwrite-strings -g -O2  -no-undefined -version-info 85:1:85 -Wl,--version-script=./libpam.map -Wl,--a
            s-needed -Wl,--no-undefined -Wl,-O1 -o libpam.la -rpath /home/teague/System/apps/spack/opt/spack/lin
            ux-pop22-zen3/gcc-14.1.0/linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/lib pam_account.lo pam_aut
            h.lo pam_data.lo pam_delay.lo pam_dispatch.lo pam_end.lo pam_env.lo pam_get_authtok.lo pam_handlers.
            lo pam_item.lo pam_misc.lo pam_password.lo pam_prelude.lo pam_session.lo pam_start.lo pam_strerror.l
            o pam_vprompt.lo pam_syslog.lo pam_dynamic.lo pam_audit.lo pam_modutil_check_user.lo pam_modutil_cle
            anup.lo pam_modutil_getpwnam.lo pam_modutil_ioloop.lo pam_modutil_getgrgid.lo pam_modutil_getpwuid.l
            o pam_modutil_getgrnam.lo pam_modutil_getspnam.lo pam_modutil_getlogin.lo pam_modutil_ingroup.lo pam
            _modutil_priv.lo pam_modutil_sanitize.lo pam_modutil_searchkey.lo
     489    libtool: link: /home/teague/System/apps/spack/lib/spack/env/gcc/gcc -shared  -fPIC -DPIC  .libs/pam_
            account.o .libs/pam_auth.o .libs/pam_data.o .libs/pam_delay.o .libs/pam_dispatch.o .libs/pam_end.o .
            libs/pam_env.o .libs/pam_get_authtok.o .libs/pam_handlers.o .libs/pam_item.o .libs/pam_misc.o .libs/
            pam_password.o .libs/pam_prelude.o .libs/pam_session.o .libs/pam_start.o .libs/pam_strerror.o .libs/
            pam_vprompt.o .libs/pam_syslog.o .libs/pam_dynamic.o .libs/pam_audit.o .libs/pam_modutil_check_user.
            o .libs/pam_modutil_cleanup.o .libs/pam_modutil_getpwnam.o .libs/pam_modutil_ioloop.o .libs/pam_modu
            til_getgrgid.o .libs/pam_modutil_getpwuid.o .libs/pam_modutil_getgrnam.o .libs/pam_modutil_getspnam.
            o .libs/pam_modutil_getlogin.o .libs/pam_modutil_ingroup.o .libs/pam_modutil_priv.o .libs/pam_moduti
            l_sanitize.o .libs/pam_modutil_searchkey.o    -g -O2 -Wl,--version-script=./libpam.map -Wl,--as-need
            ed -Wl,--no-undefined -Wl,-O1   -Wl,-soname -Wl,libpam.so.0 -o .libs/libpam.so.0.85.1
     490    /usr/bin/ld: .libs/pam_get_authtok.o: in function `pam_get_authtok_internal':
  >> 491    /tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/spack-src/libpa
            m/pam_get_authtok.c:166: undefined reference to `libintl_dgettext'
  >> 492    /usr/bin/ld: /tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/sp
            ack-src/libpam/pam_get_authtok.c:157: undefined reference to `libintl_dgettext'
  >> 493    /usr/bin/ld: /tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/sp
            ack-src/libpam/pam_get_authtok.c:184: undefined reference to `libintl_dgettext'
  >> 494    /usr/bin/ld: /tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/sp
            ack-src/libpam/pam_get_authtok.c:178: undefined reference to `libintl_dgettext'
  >> 495    /usr/bin/ld: /tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by4il5a7sahjcg/sp
            ack-src/libpam/pam_get_authtok.c:150: undefined reference to `libintl_dgettext'
  >> 496    /usr/bin/ld: .libs/pam_get_authtok.o:/tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav
            3fgo2v7by4il5a7sahjcg/spack-src/libpam/pam_get_authtok.c:151: more undefined references to `libintl_
            dgettext' follow
  >> 497    collect2: error: ld returned 1 exit status
  >> 498    make[2]: *** [Makefile:554: libpam.la] Error 1
     499    make[2]: Leaving directory '/tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by
            4il5a7sahjcg/spack-src/libpam'
  >> 500    make[1]: *** [Makefile:496: all-recursive] Error 1
     501    make[1]: Leaving directory '/tmp/teague/spack-stage/spack-stage-linux-pam-1.5.2-qrnwx6ngjav3fgo2v7by
            4il5a7sahjcg/spack-src'
  >> 502    make: *** [Makefile:426: all] Error 2
</pre></details>

Note that while this is building with `gcc@14` the same issue occurred when testing with `gcc@11`. It didn't seem like a GCC issue, but wanted to capture that it had been tested.

### Information on your system

```
* **Spack:** 0.23.0.dev0 (391c4cf099e67e5eb3f3734d30946c890a4442f6)
* **Python:** 3.10.12
* **Platform:** linux-pop22-zen3
* **Concretizer:** clingo
```

### Additional information

[spack-build-out.txt](https://github.com/user-attachments/files/15753448/spack-build-out.txt)
[spack-build-env.txt](https://github.com/user-attachments/files/15753449/spack-build-env.txt)

This should be an easy fix, but I need to test and create a PR if it works. Considering this is a a security-related library, I wanted to capture the issue to get eyes on it.

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/linux-pam/package.py b/var/spack/repos/builtin/packages/linux-pam/package.py
--- a/var/spack/repos/builtin/packages/linux-pam/package.py
+++ b/var/spack/repos/builtin/packages/linux-pam/package.py
@@ -21,17 +21,11 @@ class LinuxPam(AutotoolsPackage):
     version("1.3.1", sha256="eff47a4ecd833fbf18de9686632a70ee8d0794b79aecb217ebd0ce11db4cd0db")
 
     depends_on("libtirpc")
-
-    depends_on("m4", type="build")
-    depends_on("autoconf", type="build")
-    depends_on("automake", type="build")
-    depends_on("libtool", type="build")
-
-    def flag_handler(self, name, flags):
-        if name == "ldflags":
-            flags.append("-lintl")  # spack/spack#44637
-        return (flags, None, None)
+    depends_on("libxcrypt")
 
     def configure_args(self):
-        config_args = ["--includedir=" + self.prefix.include.security]
-        return config_args
+        return [
+            "--disable-nls",
+            "--disable-regenerate-docu",
+            f"--includedir={self.prefix.include.security}",
+        ]


Test patch: