Repository: spack/spack

Issue:
Installation issue: gnuplot 5.4.3
### Steps to reproduce the issue

```console
$ spack spec -I gnuplot
Input spec
--------------------------------
 -   gnuplot

Concretized
--------------------------------
[+]  gnuplot@5.4.3%gcc@9.1.0~X+cairo+gd+libcerf~pbm~qt+readline~wx build_system=autotools patches=ad89f23 arch=linux-centos7-skylake_avx512
[+]      ^cairo@1.16.0%gcc@9.1.0+X+fc+ft+gobject+pdf~png~svg build_system=autotools patches=7c4da77 arch=linux-centos7-skylake_avx512
[+]          ^autoconf@2.69%gcc@9.1.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-centos7-skylake_avx512
[+]              ^perl@5.38.0%gcc@9.1.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-centos7-skylake_avx512
[+]                  ^berkeley-db@18.1.40%gcc@9.1.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-centos7-skylake_avx512
[+]          ^automake@1.16.5%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^fontconfig@2.14.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^font-util@1.4.0%gcc@9.1.0 build_system=autotools fonts=encodings,font-adobe-100dpi,font-adobe-75dpi,font-adobe-utopia-100dpi,font-adobe-utopia-75dpi,font-adobe-utopia-type1,font-alias,font-arabic-misc,font-bh-100dpi,font-bh-75dpi,font-bh-lucidatypewriter-100dpi,font-bh-lucidatypewriter-75dpi,font-bh-type1,font-bitstream-100dpi,font-bitstream-75dpi,font-bitstream-speedo,font-bitstream-type1,font-cronyx-cyrillic,font-cursor-misc,font-daewoo-misc,font-dec-misc,font-ibm-type1,font-isas-misc,font-jis-misc,font-micro-misc,font-misc-cyrillic,font-misc-ethiopic,font-misc-meltho,font-misc-misc,font-mutt-misc,font-schumacher-misc,font-screen-cyrillic,font-sun-misc,font-winitzki-cyrillic,font-xfree86-type1 arch=linux-centos7-skylake_avx512
[+]                  ^bdftopcf@1.1%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                      ^fontsproto@2.1.3%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                      ^libxfont@1.5.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                  ^mkfontdir@1.0.7%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                  ^mkfontscale@1.2.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                      ^libfontenc@1.1.7%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^gperf@3.1%gcc@9.1.0 build_system=autotools patches=3dd36db arch=linux-centos7-skylake_avx512
[+]              ^libxml2@2.10.3%gcc@9.1.0~python build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^util-linux-uuid@2.38.1%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^freetype@2.11.1%gcc@9.1.0+pic+shared build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^bzip2@1.0.8%gcc@9.1.0~debug~pic+shared build_system=generic arch=linux-centos7-skylake_avx512
[+]          ^glib@2.76.4%gcc@9.1.0~libmount~strip build_system=meson buildtype=release default_library=shared tracing=none arch=linux-centos7-skylake_avx512
[+]              ^elfutils@0.189%gcc@9.1.0~debuginfod+nls build_system=autotools arch=linux-centos7-skylake_avx512
[+]                  ^zstd@1.5.5%gcc@9.1.0+programs build_system=makefile compression=none libs=shared,static arch=linux-centos7-skylake_avx512
[+]              ^pcre2@10.42%gcc@9.1.0~jit+multibyte build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^zlib-ng@2.1.3%gcc@9.1.0+compat+opt build_system=autotools patches=299b958,ae9077a,b692621 arch=linux-centos7-skylake_avx512
[+]          ^libtool@2.4.7%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libx11@1.8.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^inputproto@2.3.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^kbproto@1.0.7%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^xextproto@7.3.0%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^xtrans@1.4.0%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libxcb@1.14%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^libpthread-stubs@0.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^libxau@1.0.8%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^libxdmcp@1.1.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                  ^libbsd@0.11.7%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]                      ^libmd@1.0.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^xcb-proto@1.15.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libxext@1.3.3%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libxrender@0.9.10%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^renderproto@0.11.1%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^m4@1.4.19%gcc@9.1.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-centos7-skylake_avx512
[+]              ^diffutils@3.9%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^libsigsegv@2.14%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^pixman@0.42.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^bison@3.8.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^flex@2.6.3%gcc@9.1.0+lex~nls build_system=autotools arch=linux-centos7-skylake_avx512
[+]                  ^findutils@4.9.0%gcc@9.1.0 build_system=autotools patches=440b954 arch=linux-centos7-skylake_avx512
[+]          ^python@3.10.12%gcc@9.1.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,7d40923,f2fd060 arch=linux-centos7-skylake_avx512
[+]              ^expat@2.5.0%gcc@9.1.0+libbsd build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^gdbm@1.23%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^libxcrypt@4.4.35%gcc@9.1.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-centos7-skylake_avx512
[+]              ^openssl@3.1.2%gcc@9.1.0~docs+shared build_system=generic certs=mozilla arch=linux-centos7-skylake_avx512
[+]                  ^ca-certificates-mozilla@2023-05-30%gcc@9.1.0 build_system=generic arch=linux-centos7-skylake_avx512
[+]              ^sqlite@3.42.0%gcc@9.1.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^xz@5.4.1%gcc@9.1.0~pic build_system=autotools libs=shared,static arch=linux-centos7-skylake_avx512
[+]          ^which@2.21%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]      ^libcerf@1.3%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]      ^libgd@2.3.3%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^gettext@0.21.1%gcc@9.1.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^tar@1.34%gcc@9.1.0 build_system=autotools zip=pigz arch=linux-centos7-skylake_avx512
[+]                  ^pigz@2.7%gcc@9.1.0 build_system=makefile arch=linux-centos7-skylake_avx512
[+]          ^libjpeg-turbo@3.0.0%gcc@9.1.0~ipo~jpeg8+shared+static build_system=cmake build_type=Release generator=make arch=linux-centos7-skylake_avx512
[+]              ^cmake@3.27.4%gcc@9.1.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-centos7-skylake_avx512
[+]                  ^curl@8.1.2%gcc@9.1.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-centos7-skylake_avx512
[+]                      ^nghttp2@1.52.0%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^gmake@4.4.1%gcc@9.1.0~guile build_system=autotools arch=linux-centos7-skylake_avx512
[+]              ^nasm@2.15.05%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libpng@1.6.39%gcc@9.1.0~ipo build_system=cmake build_type=Release generator=make libs=shared,static arch=linux-centos7-skylake_avx512
[+]          ^libtiff@4.5.1%gcc@9.1.0+ccitt~ipo~jbig+jpeg~jpeg12~lerc~libdeflate+logluv~lzma+lzw+next~old-jpeg+packbits~pic~pixarlog+shared+thunder~webp+zlib~zstd build_system=cmake build_type=Release generator=make arch=linux-centos7-skylake_avx512
[+]      ^libiconv@1.17%gcc@9.1.0 build_system=autotools libs=shared,static arch=linux-centos7-skylake_avx512
[+]      ^libxpm@3.5.12%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^util-macros@1.19.3%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^xproto@7.0.31%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]      ^pango@1.50.13%gcc@9.1.0+X~strip build_system=meson buildtype=release default_library=shared arch=linux-centos7-skylake_avx512
[+]          ^fribidi@1.0.12%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^gobject-introspection@1.76.1%gcc@9.1.0~strip build_system=meson buildtype=release default_library=shared arch=linux-centos7-skylake_avx512
[+]          ^harfbuzz@7.3.0%gcc@9.1.0~graphite2~strip build_system=meson buildtype=release default_library=shared arch=linux-centos7-skylake_avx512
[+]              ^icu4c@67.1%gcc@9.1.0 build_system=autotools cxxstd=11 arch=linux-centos7-skylake_avx512
[+]          ^json-glib@1.6.6%gcc@9.1.0~strip build_system=meson buildtype=release default_library=shared arch=linux-centos7-skylake_avx512
[+]          ^libffi@3.4.4%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^libxft@2.3.2%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]          ^meson@1.2.0%gcc@9.1.0 build_system=python_pip patches=0f0b1bd arch=linux-centos7-skylake_avx512
[+]              ^py-pip@23.1.2%gcc@9.1.0 build_system=generic arch=linux-centos7-skylake_avx512
[+]              ^py-setuptools@68.0.0%gcc@9.1.0 build_system=generic arch=linux-centos7-skylake_avx512
[+]              ^py-wheel@0.37.1%gcc@9.1.0 build_system=generic arch=linux-centos7-skylake_avx512
[+]          ^ninja@1.11.1%gcc@9.1.0+re2c build_system=generic arch=linux-centos7-skylake_avx512
[+]              ^re2c@2.2%gcc@9.1.0 build_system=generic arch=linux-centos7-skylake_avx512
[+]      ^pkgconf@1.9.5%gcc@9.1.0 build_system=autotools arch=linux-centos7-skylake_avx512
[+]      ^readline@8.2%gcc@9.1.0 build_system=autotools patches=bbf97f1 arch=linux-centos7-skylake_avx512
[+]          ^ncurses@6.4%gcc@9.1.0~symlinks+termlib abi=none build_system=autotools arch=linux-centos7-skylake_avx512
```


### Error message

If I install `gnuplot` using 
```
spack install -v gnuplot 
```
or using it in a `spack.yaml` file I get the following during the configure step:
<pre>
...
checking for library containing iconv_open... none required
checking for iconv.h... yes
...
</pre>

This leads to the following error during building gnuplot
<pre>
     375    /mechthild/software/spack/lib/spack/env/gcc/g++  -g -O2  -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libcerf-1.3-isbl5taeurnc27bkjpezn3vwc2dlcpzn/lib -lcerf -L/mecht
            hild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/readline-8.2-da4jhgdynpzackjxrzgdfabmg6hr5hyx/lib -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/li
            bgd-2.3.3-7erhqjxjvqpez4qjq6cyqlpdhmxivv54/lib -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o encoding.o eval.o external.o fit.o gadget
            s.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o jitter.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o
             scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o voxelgrid.o vplot.o  wxterminal/gp_cairo.o wxterminal/gp_c
            airo_helpers.o   -lreadline  -ltermcap  -lz -lgd -ljpeg -lpng -lfreetype -lz    -ldl -lm  -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/pango-1.50.13-hzkeom3bdfl2i6tyq
            tzasz6lmltcj7ln/lib -lpangocairo-1.0 -lz -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/glib-2.76.4-lq7g3u6zeqfgav7ugaje74d4jm3mrth3/lib -lgobject-2.0 -L/mechthild/soft
            ware/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/harfbuzz-7.3.0-dyhmqlsivg4h7gugv3pu5jrqfecch2g3/lib -lharfbuzz -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.
            0/gettext-0.21.1-6q3wdlhlsfdoczf5nyde7zddg6phhmd3/lib -Wl,-rpath=/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/gettext-0.21.1-6q3wdlhlsfdoczf5nyde7zddg6phhmd3/lib -lglib
            -2.0 -lintl -lpango-1.0 -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/cairo-1.16.0-6r6h5jbvmntrb7l3shdiemqqyopzmgic/lib -lcairo
  >> 376    /mechthild/software/compiler/gcc-9.1/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: encoding.o: undefined reference to symbol 'libiconv_open'
  >> 377    /mechthild/software/compiler/gcc-9.1/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libiconv-1.1
            7-gngpv3el6ngtdzdbgd2sgnx6vd5gwssk/lib/libiconv.so.2: error adding symbols: DSO missing from command line
  >> 378    collect2: error: ld returned 1 exit status
  >> 379    make[4]: *** [Makefile:839: gnuplot] Error 1
</pre></details>


### Information on your system

<pre>
* **Spack:** 0.21.0.dev0
* **Python:** 3.6.8
* **Platform:** linux-centos7-skylake_avx512
* **Concretizer:** clingo
</pre>

### Additional information

The crucial part from `config.log` looks like:
```
configure:12892: checking for library containing iconv_open
configure:12922: /mechthild/software/spack/lib/spack/env/gcc/gcc -o conftest -g -O2  -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libcerf-1.3-isbl5taeurnc27bkjpezn3vwc2dlcpzn/include -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/readline-8.2-da4jhgdynpzackjxrzgdfabmg6hr5hyx/include -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libgd-2.3.3-7erhqjxjvqpez4qjq6cyqlpdhmxivv54/include  -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libcerf-1.3-isbl5taeurnc27bkjpezn3vwc2dlcpzn/lib -lcerf -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/readline-8.2-da4jhgdynpzackjxrzgdfabmg6hr5hyx/lib -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libgd-2.3.3-7erhqjxjvqpez4qjq6cyqlpdhmxivv54/lib conftest.c -ldl -lm  >&5
configure:12922: $? = 0
configure:12942: result: none required
configure:12948: checking for iconv.h
configure:12948: /mechthild/software/spack/lib/spack/env/gcc/gcc -c -g -O2  -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libcerf-1.3-isbl5taeurnc27bkjpezn3vwc2dlcpzn/include -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/readline-8.2-da4jhgdynpzackjxrzgdfabmg6hr5hyx/include -I/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libgd-2.3.3-7erhqjxjvqpez4qjq6cyqlpdhmxivv54/include conftest.c >&5
configure:12948: $? = 0
configure:12948: result: yes
```

In the build phase this leads to 
```
/mechthild/software/spack/lib/spack/env/gcc/g++  -g -O2  -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libcerf-1.3-isbl5taeurnc27bkjpezn3vwc2dlcpzn/lib -lcerf -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/readline-8.2-da4jhgdynpzackjxrzgdfabmg6hr5hyx/lib -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libgd-2.3.3-7erhqjxjvqpez4qjq6cyqlpdhmxivv54/lib -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o encoding.o eval.o external.o fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o jitter.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o voxelgrid.o vplot.o  wxterminal/gp_cairo.o wxterminal/gp_cairo_helpers.o   -lreadline  -ltermcap  -lz -lgd -ljpeg -lpng -lfreetype -lz    -ldl -lm  -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/pango-1.50.13-hzkeom3bdfl2i6tyqtzasz6lmltcj7ln/lib -lpangocairo-1.0 -lz -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/glib-2.76.4-lq7g3u6zeqfgav7ugaje74d4jm3mrth3/lib -lgobject-2.0 -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/harfbuzz-7.3.0-dyhmqlsivg4h7gugv3pu5jrqfecch2g3/lib -lharfbuzz -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/gettext-0.21.1-6q3wdlhlsfdoczf5nyde7zddg6phhmd3/lib -Wl,-rpath=/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/gettext-0.21.1-6q3wdlhlsfdoczf5nyde7zddg6phhmd3/lib -lglib-2.0 -lintl -lpango-1.0 -L/mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/cairo-1.16.0-6r6h5jbvmntrb7l3shdiemqqyopzmgic/lib -lcairo
/mechthild/software/compiler/gcc-9.1/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: encoding.o: undefined reference to symbol 'libiconv_open'
/mechthild/software/compiler/gcc-9.1/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mechthild/software/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.1.0/libiconv-1.17-gngpv3el6ngtdzdbgd2sgnx6vd5gwssk/lib/libiconv.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:839: gnuplot] Error 1
```


My current workaround was the following patch of the gnuplot package:
```
diff --git a/var/spack/repos/builtin/packages/gnuplot/package.py b/var/spack/repos/builtin/packages/gnuplot/package.py
index 20f567d..918621e 100644
--- a/var/spack/repos/builtin/packages/gnuplot/package.py
+++ b/var/spack/repos/builtin/packages/gnuplot/package.py
@@ -160,7 +160,7 @@ def configure_args(self):
         # TODO: --with-aquaterm  depends_on('aquaterm')
         options.append("--without-aquaterm")
 
-        if spec.satisfies("%gcc@11:"):
+        if spec.satisfies("%gcc@9:"):
             os.environ["LDFLAGS"] = "-Wl,--copy-dt-needed-entries"
 
         return options
```
Which seems that the assuption with gcc >= 11 is wrong and needs at least to be gcc >= 9.

### 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/gnuplot/package.py b/var/spack/repos/builtin/packages/gnuplot/package.py
--- a/var/spack/repos/builtin/packages/gnuplot/package.py
+++ b/var/spack/repos/builtin/packages/gnuplot/package.py
@@ -162,7 +162,7 @@ def configure_args(self):
         # TODO: --with-aquaterm  depends_on('aquaterm')
         options.append("--without-aquaterm")
 
-        if spec.satisfies("%gcc@11:"):
+        if spec.satisfies("%gcc@8:"):
             os.environ["LDFLAGS"] = "-Wl,--copy-dt-needed-entries"
 
         return options


Test patch: