[Nix-dev] GFortran 4.6 spec broken?

Ludovic Courtès ludo at gnu.org
Thu Mar 8 18:13:55 CET 2012


Hello!

Suppose ‘t.f’ that contains this:

--8<---------------cut here---------------start------------->8---
      subroutine foo
      implicit none
      integer a
      a=0
      return
      end
--8<---------------cut here---------------end--------------->8---

When compiling it with our gfortran45, with ‘gfortran -shared -v t.f’,
we get:

--8<---------------cut here---------------start------------->8---
Driving: /nix/store/qpmn8pnpgxml2lw7ffpa8pkz62rafshw-gfortran-4.5.3/bin/gfortran -Wl,-dynamic-linker -Wl,/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib/ld-linux-x86-64.so.2 -shared -v t.f -B/nix/store/qpmn8pnpgxml2lw7ffpa8pkz62rafshw-gfortran-4.5.3/lib64 -B/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib/ -idirafter /nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/include -idirafter /nix/store/qpmn8pnpgxml2lw7ffpa8pkz62rafshw-gfortran-4.5.3/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/include-fixed -B/nix/store/iahs1cm7d5zhfwpjzvznzw5l8x17wibc-gfortran-wrapper-4.5.3/bin/ -I/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/include -I/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/include -I/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/include -I/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/include -I/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/include -I/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/include -Wl,-rpath -Wl,/nix/store/wjlk11c82dgh5hwhdy74lpz7hqxcvxbg-eztrace-0/lib64 -Wl,-rpath -Wl,/nix/store/wjlk11c82dgh5hwhdy74lpz7hqxcvxbg-eztrace-0/lib -L/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/lib -L/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/lib -L/nix/store/qav9f8hj8rh7kr6s1iblqik6h3p6jzml-perl-5.14.2/lib -L/nix/store/qav9f8hj8rh7kr6s1iblqik6h3p6jzml-perl-5.14.2/lib -L/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/lib -L/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/lib -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib64 -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib64 -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib -L/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib -L/nix/store/qpmn8pnpgxml2lw7ffpa8pkz62rafshw-gfortran-4.5.3/lib64 -L/nix/store/qpmn8pnpgxml2lw7ffpa8pkz62rafshw-gfortran-4.5.3/lib -lgfortran -lm -shared-libgcc
--8<---------------cut here---------------end--------------->8---

With our gfortran46, we get:

--8<---------------cut here---------------start------------->8---
Driving: /nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/bin/gfortran -Wl,-dynamic-linker -Wl,/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib/ld-linux-x86-64.so.2 -shared -v t.f -B/nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib64 -B/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib/ -idirafter /nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/include -idirafter /nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed -B/nix/store/blsdhiik2lk4zmz3hbzf77g6hcrq7ckx-gfortran-wrapper-4.6.3/bin/ -I/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/include -I/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/include -I/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/include -I/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/include -I/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/include -I/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/include -Wl,-rpath -Wl,/nix/store/wjlk11c82dgh5hwhdy74lpz7hqxcvxbg-eztrace-0/lib64 -Wl,-rpath -Wl,/nix/store/wjlk11c82dgh5hwhdy74lpz7hqxcvxbg-eztrace-0/lib -L/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/lib -L/nix/store/kqs9rd8raa1dhvfhka948yf0gphsm0i4-openmpi-1.4.2/lib -L/nix/store/qav9f8hj8rh7kr6s1iblqik6h3p6jzml-perl-5.14.2/lib -L/nix/store/qav9f8hj8rh7kr6s1iblqik6h3p6jzml-perl-5.14.2/lib -L/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/lib -L/nix/store/9iharzgnas6qz1205i9hnwfblj70d52y-libelf-0.8.13/lib -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib64 -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib64 -L/nix/store/rnzwhcgj311rhp999cl67cpmkxxjcs92-binutils-2.21.1a/lib -L/nix/store/6cgraa4mxbg1gfi95a4yhxq6yzb56s4v-glibc-2.13/lib -L/nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib64 -L/nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib -l gfortran -l m -shared-libgcc -specs=/nix/store/wnzgsfhmb3ys5ssfgpcpwjnmdzn717mk-gfortran-4.6.3/lib64/libgfortran.spec
--8<---------------cut here---------------end--------------->8---

The different is that with 4.5, we get ‘-lgfortran -lm’, whereas with
4.6 we get ‘-l gfortran -l m’ (with spaces), which is bogus and confuses
libtool.

Does anyone have an idea of what we could be doing wrong, or what could
have changed in our expressions?

Thanks,
Ludo’.



More information about the nix-dev mailing list