This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: autoconf libelf and ARM cross-compilation -lelf linking


Well, AC_CHECK_HEADERS([libelf.h],[staprun_LIBS="$staprun_LIBS -lelf"],[]) works fine in fact, I just needed a bit more info to perform the right generation of configure.
With that, cross-linking does not fail if cross environment does not have libelf.

However I was told internally to use AC_CHECK_LIB instead. So 2 points:
- This requires a symbol to test at link so I tried to find something generic in libelf.h -> "elf_begin". Feel free to find more generic
AC_CHECK_LIB(elf, elf_begin, [staprun_LIBS="$staprun_LIBS -lelf"], [])

- only have autoconf 2.67 so I don't have full patch, only modified configure.ac. If someone is interested, patch is attached.


Regards
Fred

Frederic Turgis

OMAP Platform Business Unit - OMAP System Engineering - Platform Enablement



Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920

-----Original Message-----

From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.org] On Behalf Of Turgis, Frederic
Sent: Monday, August 29, 2011 10:37 AM
To: systemtap@sourceware.org
Subject: autoconf libelf and ARM cross-compilation -lelf linking

Hi,

Cross-compilation of staprun/stapio fails on latest commit. ARM linker requests elf lib (-lelf) that my cross-compilation environment does not have:
- commit 5c854d7ca64df766c581c9ed7ff81e04c9d1fa4d has added -lelf in staprun/stapio linking
- commit 60755a94c651362c5cbc324505a9799708770742 has autoconfed elfutils usage in staprun (so linker shall not request to link against elf if not available ?)

After browsing some autoconf manual, I see that configure.ac contains AC_CHECK_HEADERS([libelf.h]) to define HAVE_LIBELF_H for conditional compilation. But few lines after, "staprun_LIBS="$staprun_LIBS -lelf" without specific condition. Is that expected to still have -lelf in command line ?

I tried to do things like AC_CHECK_HEADERS([libelf.h],[staprun_LIBS="$staprun_LIBS -lelf"],[]) but I would probably need to dig more into manual ;-)


Regards
Fred

Frederic Turgis
OMAP Platform Business Unit - OMAP System Engineering - Platform Enablement


Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920




Attachment: a.patch
Description: a.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]