This patch is in response to Corey's thread starting with 'bi-arch
support for building libpfm'.

This patch only affects libpfm being built on POWER.
To build a 64-bit library use:
        make PPCLIB64=y
To build a 32-bit library (default) use:
        make

Thanks,
-- 
Chris J Arges
Software Engineer
IBM Linux Technology Center
Austin, TX
[EMAIL PROTECTED]
diff -Naur libpfm/config.mk libpfmnew/config.mk
--- libpfm/config.mk	2008-04-25 09:43:12.000000000 -0400
+++ libpfmnew/config.mk	2008-05-19 16:04:45.000000000 -0400
@@ -117,6 +117,11 @@
 
 ifeq ($(ARCH),powerpc)
 CONFIG_PFMLIB_ARCH_POWERPC=y
+ifeq ($(DPPCARCH),64)
+CONFIG_PFMLIB_ARCH_PPC64=y
+else
+CONFIG_PFMLIB_ARCH_PPC64=n
+endif
 endif
 
 ifeq ($(ARCH),sparc)
@@ -181,3 +186,10 @@
 CFLAGS+=$(PFM_VERSION_FLAG)
 LDFLAGS+=-static
 endif
+
+# build 64-bit variant for POWERPC
+ifeq ($(CONFIG_PFMLIB_ARCH_PPC64),y)
+CFLAGS+=-m64
+LDFLAGS+=-m64
+SLDFLAGS+=-m64
+endif
diff -Naur libpfm/lib/Makefile libpfmnew/lib/Makefile
--- libpfm/lib/Makefile	2008-04-18 17:38:07.000000000 -0400
+++ libpfmnew/lib/Makefile	2008-05-19 15:53:28.000000000 -0400
@@ -100,7 +100,7 @@
 endif
 
 ifeq ($(SYS),Linux)
-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBPFM)
+SLDFLAGS+=-shared -Wl,-soname -Wl,$(VLIBPFM)
 SLIBPFM=libpfm.so.$(VERSION).$(REVISION).$(AGE)
 VLIBPFM=libpfm.so.$(VERSION)
 SOLIBEXT=so
diff -Naur libpfm/libpfms/lib/Makefile libpfmnew/libpfms/lib/Makefile
--- libpfm/libpfms/lib/Makefile	2008-02-06 15:58:29.000000000 -0500
+++ libpfmnew/libpfms/lib/Makefile	2008-05-19 15:53:53.000000000 -0400
@@ -68,7 +68,7 @@
 	$(AR) cru $@ $(OBJS)
 
 $(SLIBPFM):  $(SOBJS)
-	$(CC) -shared -Wl,-soname -Wl,libpfms.so.$(VERSION) -o $@ $(SOBJS)
+	$(CC) -shared -Wl,-soname -Wl,libpfms.so.$(VERSION) $(SLDFLAGS) -o $@ $(SOBJS)
 	$(LN) -sf $@ libpfms.so.$(VERSION)
 
 clean:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to