• Yang Jihong's avatar
    perf build: Fix build feature-dwarf_getlocations fail for old libdw · a530337b
    Yang Jihong authored
    For libdw versions below 0.177, need to link libdl.a in addition to
    libbebl.a during static compilation, otherwise
    feature-dwarf_getlocations compilation will fail.
    
    Before:
    
      $ make LDFLAGS=-static
        BUILD:   Doing 'make -j20' parallel build
      <SNIP>
      Makefile.config:483: Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157
      <SNIP>
    
      $ cat ../build/feature/test-dwarf_getlocations.make.output
      /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libebl.a(eblclosebackend.o): in function `ebl_closebackend':
      (.text+0x20): undefined reference to `dlclose'
      collect2: error: ld returned 1 exit status
    
    After:
    
      $ make LDFLAGS=-static
      <SNIP>
        Auto-detecting system features:
      ...                                   dwarf: [ on  ]
      <SNIP>
    
        $ ./perf probe
       Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
          or: perf probe [<options>] --...
    a530337b
Makefile 12.5 KB