Skip to content

libtool link failure when using compiler wrappers #84

Description

@drwells

I first noticed this in the libMesh release candidate and traced the issue back here.

I have a compiler wrapper script cxx-shim.sh:

#!/bin/sh

ccache mpic++ "$@"

configuring TIMPI to use this like

#!/bin/bash

declare -x CC="/home/drwells/Documents/Code/Shell/autoibamr/c-shim.sh"
declare -x CXX="/home/drwells/Documents/Code/Shell/autoibamr/cxx-shim.sh"

mkdir -p build
cd build
../configure

make -j4 V=1

results in a weird libtool problem:

libtool: link: /home/drwells/Documents/Code/Shell/autoibamr/cxx-shim.sh -o .libs/timpi_version-opt apps/version.o  ./.libs/libtimpi_opt.so -rpath /usr/local/lib
g++: error: unrecognized command-line option '-rpath'
make[1]: *** [Makefile:954: timpi_version-opt] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: warning: '-version-info' is ignored for programs
libtool: link: /home/drwells/Documents/Code/Shell/autoibamr/cxx-shim.sh -o .libs/timpi_version-dbg apps/version.o  ./.libs/libtimpi_dbg.so -rpath /usr/local/lib
g++: error: unrecognized command-line option '-rpath'
make[1]: *** [Makefile:942: timpi_version-dbg] Error 1
libtool: warning: '-version-info' is ignored for programs
libtool: link: /home/drwells/Documents/Code/Shell/autoibamr/cxx-shim.sh -o .libs/timpi_version-devel apps/version.o  ./.libs/libtimpi_devel.so -rpath /usr/local/lib
g++: error: unrecognized command-line option '-rpath'
make[1]: *** [Makefile:946: timpi_version-devel] Error 1

i.e., the compiler wrapper script is treated as a linker instead of as a C++ compiler and the preceding -Wl, flag is not present.

It looks like libMesh 1.5.x had a similar bug when I went back and checked - I see the same failure there when trying to link libmesh_opt.so but I don't see it in the 1.7 release candidate for libMesh itself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions