[MacPorts] #68756: gildas @202311b: duplicate LC_RPATH '/opt/local/lib/libgcc'

MacPorts noreply at macports.org
Mon Nov 27 15:07:06 UTC 2023


#68756: gildas @202311b: duplicate LC_RPATH '/opt/local/lib/libgcc'
---------------------------+----------------------
  Reporter:  pabloriviere  |      Owner:  bardeau
      Type:  defect        |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:
Resolution:                |   Keywords:
      Port:  gildas        |
---------------------------+----------------------

Comment (by bardeau):

 Dear @ryandesign,

 the problem simplifies as follows.

 1) write a fortran-based library and compile it with gfortran-mp-13:

 {{{
 bardeau-mac2 ~> cat hello.f90
 subroutine test
   print *,"Hello, world!"
 end subroutine test
 bardeau-mac2 ~> gfortran -c hello.f90
 bardeau-mac2 ~> gfortran  -dynamiclib hello.o -o libhello.so
 }}}
 Looking a it with otool -l, one can find only one occurrence of
 /opt/local/lib/libgcc as a LC_RPATH.

 But, when compiling gildas with MacPorts, we also add the contents of
 ${configure.ldflags} when linking the dynamic library. During the install
 process I see this debug message:

 {{{
 DEBUG: compilers PG: RPATH added to ldflags as GCC version is 13
 }}}

 In practice this translates as:
 {{{
 ~> gfortran  -dynamiclib -L/opt/local/lib -Wl,-headerpad_max_install_names
 -Wl,-rpath,/opt/local/lib/libgcc hello.o -o libhello.so
 ld: warning: duplicate -rpath '/opt/local/lib/libgcc' ignored
 }}}
 In this case, /opt/local/lib/libgcc appears twice as a LC_RPATH. Note that
 the warning "duplicate rpath ignored" does not seem correct.

 Now I do not know the right answer to this problem. What has changed with
 gfortran 12? Is the ${configure.ldflags} misconfigured? I tried to locally
 remove the ${configure.ldflags} from my link lines: this fixes the
 compilation, execution runs well, but I need to test if the compilation
 with e.g. gcc 12 is still working.

 Any advice?

-- 
Ticket URL: <https://trac.macports.org/ticket/68756#comment:18>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list