Skip to content

Conversation

ilumsden
Copy link
Contributor

Resolves #50

This PR tweaks the pkg-config stuff for PerfFlow Aspect to allow an Autotools-based project (i.e., DYAD) to correctly load the C/C++ interface for PerfFlow. In particular, this PR does the following:

  • Adds a static version of libperfflow_parser.so to the build. Note that this static library is not installed
  • Tweaks the build of WeavePass to use this static library (resolves linking/lookup issues when using the Clang plugin)
  • Removes WeavePass from the Libs entry of perfflowaspect.pc
  • Adds -lssl and -lcrypto to the Libs entry of perfflowaspect.pc to prevent undefined symbol errors on SHA1
  • Removes the content of the Cflags entry of perfflowaspect.pc
  • Adds a new weavepass entry to perfflowaspect.pc. This entry's value is the path to libWeavePass.so

Additionally, in DYAD, I created the following m4 macro to actually load all the info from pkg-config into the Autotools-based build system:

AC_DEFUN([AX_PERFFLOW_ASPECT], [
    PKG_CHECK_MODULES([$1], [perfflowaspect],
        [
            $1_WEAVEPASS=`pkg-config --variable=weavepass perfflowaspect`
            if test ! -e "${$1_WEAVEPASS}"; then
                AC_MSG_ERROR([Cannot find libWeavePass.so!])
            fi
            $1_PLUGIN_CPPFLAGS="-Xclang -load -Xclang ${$1_WEAVEPASS} -fPIC"
            AC_MSG_NOTICE([Flags are ${$1_PLUGIN_CPPFLAGS}])
            AC_SUBST($1_WEAVEPASS)
            AC_SUBST($1_PLUGIN_CPPFLAGS)
            $2
        ],
        [
            $3
        ]
    )
])

In DYAD, this is put into config/ax_perfflow_aspect.m4. This file is not included in this PR, but I can include it if desired.

slabasan
slabasan previously approved these changes Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants