David Gibson wrote: > On Tue, Dec 28, 2010 at 05:37:44PM -0600, Andrew Hastings wrote: >> libhugetlbfs redefines shmget() so that it can transparently optionally >> add the hugepage flag. Unfortunately, it uses dlsym() to to find the >> next shmget() to call in the dynamic library call chain. This does not >> work on statically-linked executables. >> >> Work around this by making all references to libdl weak, and testing >> for its presence. If libdl symbols are not not present, directly >> make the shmget syscall. >> >> Making the dl* symbols weak does not affect dynamic executables as >> libdl.so is: >> * Automatically added to the library dependency list when liked with >> -lhugetlbfs >> * Mapped into the programs address space when used with LD_PRELOAD. >> >> Based on a patch originally authored by Dean Luick <lu...@cray.com>. >> >> Signed-off-by: Andrew Hastings <a...@cray.com> on behalf of Cray Inc. > > I'm mildly surprised there isn't rather more to fix to get > libhugetlbfs to work with static executables. A dynamic executable > was pretty firmly assumed when it was created. > > What components of the libary have you tested with a static executable > and this patch? >
This particular patch has been tested only with the HUGETLB_MORECORE feature, our most common use case. Dean <lu...@cray.com> has been working on a more invasive patch which enables text and data remapping for static executables. It is independent from this shmget patch, and we are not yet ready to submit it to the mailing list. We hope to do so in future. -Andrew Hastings Cray Inc. ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel