Skip to content

Cannot compile application that links with PerfFlow Aspect via pkg-config #50

@ilumsden

Description

@ilumsden

I am trying to integrate PerfFlow Aspect into DYAD's new Autotools-based build system. To locate and link PFA, I am using pkg-config and the PKG_CHECK_MODULE m4 macro in my configury. When trying to compile DYAD with PFA support, I got the following error:

error: unable to load plugin '-faddrsig': '-faddrsig: cannot open shared object file: No such file or directory'
make[2]: *** [Makefile:489: dyad_la-dyad.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
error: unable to load plugin '-faddrsig': '-faddrsig: cannot open shared object file: No such file or directory'

For reference, I confirmed that -faddrsig is being introduced automatically by Clang (not Autotools). To test if this issue was being caused by PFA's .pc file, I run DYAD compilation with 3 .pc files that differ in terms of the Cflags and Libs entries:

Original:

Libs: -L${libdir} -lperfflow_runtime -L${libdir} -lperfflow_parser -L${libdir} -lWeavePass
Cflags: -Wc,-Xclang,-load

New w/ Spaces:

Libs: -L${libdir} -lperfflow_runtime -L${libdir} -lperfflow_parser
Cflags: -Wc -Xclang -load -Xclang ${libdir}/libWeavePass.so

New w/o Spaces:

Libs: -L${libdir} -lperfflow_runtime -L${libdir} -lperfflow_parser
Cflags: -Wc,-Xclang,-load,-Xclang,${libdir}/libWeavePass.so

When using the original .pc file, I got the error that I mentioned that the beginning of this comment. When using the new .pc file with spaces, I got the same error as the original, along with the following warning:

warning: unknown warning option '-Wc' [-Wunknown-warning-option]

Interestingly, when I ran with the new .pc file without spaces, I got a different error:

error: unable to load plugin '-I../../src/common': '-I../../src/common: cannot open shared object file: No such file or directory'

Obviously, the -I flag is not a plugin, so something about the ordering of the command-line arguments to clang is messed up. Given that this change in error happens only when changing the .pc file, this implies that this issue seems to be driven by the .pc file.

For reference, I was running all of this on Lassen (POWER9 system), with the following modules/libraries used for dependencies:

  • clang/10.0.1-gcc-8.3.1 (which is recommended in the following PFA README)
  • cmake/3.23.1
  • Other dependencies are satisfied by system defaults

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions