tools build: Add -lrt to FEATURE_CHECK_LDFLAGS-libaio
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Feb 2019 14:20:56 +0000 (11:20 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Feb 2019 18:17:40 +0000 (15:17 -0300)
commitaa8f9c517ebce7a0959da064ef2660ea03f133f8
tree0c6b2b8365c3a9c07e87384de07602607f116c0a
parent1da7e0022784b0e05b49bf73521fa2cc4633af85
tools build: Add -lrt to FEATURE_CHECK_LDFLAGS-libaio

Since we need it to resolve the AIO symbols, otherwise we fail with:

  $ cat /tmp/build/perf/feature/test-all.make.output
  /usr/bin/ld: /tmp/ccEqrj36.o: undefined reference to symbol 'aio_return64@@GLIBC_2.2.5'
  /usr/bin/ld: //usr/lib64/librt.so.1: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  $

When we added the aio support in 'perf record' only the test-libaio.bin
target got the -lrt, i.e. the feature detection slow path. Fix it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 2a07d814747b ("tools build feature: Check if libaio is available")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.config