[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#765370: xutils-dev: fix CCOPTIONS/LDOPTIONS causing FTBFS on sciplot on ppc64el [PATCH]



Package: src:xutils-dev
Version: 1:7.7+3
Tags: patch
User: debian-powerpc@lists.debian.org
Usertags: ppc64el

The attached patch adds the ppc64el pieces and fixes a FTBFS on sciplot
(and potentially others), avoiding to pass -mminimal-toc from CCOPTIONS
to LDOPTIONS (because it's incorrect for 'ld -m<value>').

May you please consider it for an upload?

Thanks!


Details:
--------

The fixed FTBFS error [1]:

ld -shared -o libsciplot.so.1.36 SciPlot.o SciPlotUtil.o -mminimal-toc -lXm [...] -soname libsciplot.so.1 -lc
	ld: unrecognised emulation mode: minimal-toc
Supported emulations: elf64lppc elf32lppc elf32lppclinux elf32lppcsim elf32ppclinux elf32ppc elf32ppcsim elf64ppc
	make[2]: *** [shared] Error 1
	
[1] https://buildd.debian.org/status/fetch.php?pkg=sciplot&arch=ppc64el&ver=1.36-16&stamp=1410447072

--
Mauricio Faria de Oliveira
IBM Linux Technology Center
diff -Nru xutils-dev-7.7+3/debian/changelog xutils-dev-7.7+3ppc64el1/debian/changelog
--- xutils-dev-7.7+3/debian/changelog	2014-05-21 16:46:36.000000000 -0300
+++ xutils-dev-7.7+3ppc64el1/debian/changelog	2014-10-14 10:49:40.000000000 -0300
@@ -1,3 +1,12 @@
+xutils-dev (1:7.7+3ppc64el1) UNRELEASED; urgency=medium
+
+  * 98_ppc64el-not-ld-options.diff: Add DefaultNotLDOptions/NOTLDOPTIONS for
+    filtering out CCOPTIONS that are not valid LDOPTIONS (cause linker errors).
+  * 99_ppc64el.diff: Add support for ppc64el as little-endian ppc64.
+    (Credits: Adam Conrad)
+
+ -- Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>  Tue, 14 Oct 2014 10:45:41 -0300
+
 xutils-dev (1:7.7+3) unstable; urgency=medium
 
   * gccmakedep 1.0.3.
diff -Nru xutils-dev-7.7+3/debian/patches/98_ppc64el-not-ld-options.diff xutils-dev-7.7+3ppc64el1/debian/patches/98_ppc64el-not-ld-options.diff
--- xutils-dev-7.7+3/debian/patches/98_ppc64el-not-ld-options.diff	1969-12-31 21:00:00.000000000 -0300
+++ xutils-dev-7.7+3ppc64el1/debian/patches/98_ppc64el-not-ld-options.diff	2014-10-14 10:44:36.000000000 -0300
@@ -0,0 +1,34 @@
+Description: Some CCOPTIONS are not valid LDOPTIONS (e.g., -mminimal-toc), so filter-out NOTLDOPTIONS
+Author: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
+Last-Update: 2014-10-14
+ 
+diff -Nru xorg-cf-files.orig/Imake.tmpl xorg-cf-files/Imake.tmpl
+--- a/xorg-cf-files/Imake.tmpl	2014-10-14 10:02:03.000000000 -0300
++++ b/xorg-cf-files/Imake.tmpl	2014-10-14 10:24:50.000000000 -0300
+@@ -2165,6 +2165,7 @@
+ 
+       CDEBUGFLAGS = DefaultCDebugFlags
+         CCOPTIONS = DefaultCCOptions	/* to distinguish from param flags */
++     NOTLDOPTIONS = DefaultNotLDOptions	/* not to be used as linker options */
+ /*
+  * STD_INCLUDES contains system-specific includes
+  * TOP_INCLUDES specifies how to get to /usr/include or its build substitute
+@@ -2179,6 +2180,7 @@
+          LDPRELIB = LdPreLib $(INSTALLED_LIBS)
+         LDPOSTLIB = LdPostLib
+         LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)  $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
++        LDOPTIONS := $(filter-out $(NOTLDOPTIONS),$(LDOPTIONS))
+      CXXLDOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
+ 
+            LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+diff -Nru xorg-cf-files.orig/linux.cf xorg-cf-files/linux.cf
+--- a/xorg-cf-files.orig/linux.cf	2014-10-14 10:02:03.000000000 -0300
++++ b/xorg-cf-files/linux.cf	2014-10-14 10:21:52.000000000 -0300
+@@ -1005,6 +1005,7 @@
+ 
+ #ifdef Ppc64Architecture
+ # define DefaultCCOptions	-mminimal-toc
++# define DefaultNotLDOptions	-mminimal-toc
+ # ifndef OptimizedCDebugFlags
+ #  define OptimizedCDebugFlags	DefaultGcc2Ppc64Opt GccAliasingArgs
+ # endif
diff -Nru xutils-dev-7.7+3/debian/patches/99_ppc64el.diff xutils-dev-7.7+3ppc64el1/debian/patches/99_ppc64el.diff
--- xutils-dev-7.7+3/debian/patches/99_ppc64el.diff	1969-12-31 21:00:00.000000000 -0300
+++ xutils-dev-7.7+3ppc64el1/debian/patches/99_ppc64el.diff	2014-10-14 10:44:41.000000000 -0300
@@ -0,0 +1,32 @@
+Description: Add support for ppc64el as little-endian ppc64.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Origin: https://launchpadlibrarian.net/160111286/xutils-dev_1:7.7~1ubuntu5_1:7.7~1ubuntu6.diff.gz
+Last-Update: 2014-10-14
+
+diff -Nru xutils-dev-7.7~1ubuntu5/xorg-cf-files/Imake.cf xutils-dev-7.7~1ubuntu6/xorg-cf-files/Imake.cf
+--- xutils-dev-7.7~1ubuntu5/xorg-cf-files/Imake.cf	2013-07-30 12:22:15.000000000 -0600
++++ xutils-dev-7.7~1ubuntu6/xorg-cf-files/Imake.cf	2013-12-18 05:22:24.000000000 -0700
+@@ -930,6 +930,11 @@
+ #  undef __powerpc__
+ # endif
+ # ifdef __powerpc64__
++#  ifdef __LITTLE_ENDIAN__
++#    ifndef Ppc64elArchitecture
++#      define Ppc64elArchitecture
++#    endif
++#  endif
+ #  ifndef Ppc64Architecture
+ #   define Ppc64Architecture
+ #  endif
+diff -Nru xutils-dev-7.7~1ubuntu5/xorg-cf-files/Imake.tmpl xutils-dev-7.7~1ubuntu6/xorg-cf-files/Imake.tmpl
+--- xutils-dev-7.7~1ubuntu5/xorg-cf-files/Imake.tmpl	2013-07-30 16:53:35.000000000 -0600
++++ xutils-dev-7.7~1ubuntu6/xorg-cf-files/Imake.tmpl	2013-12-18 05:25:04.000000000 -0700
+@@ -528,6 +528,8 @@
+ #define ByteOrder		X_LITTLE_ENDIAN
+ #elif defined(RsArchitecture)
+ #define ByteOrder		X_BIG_ENDIAN
++#elif defined(Ppc64elArchitecture)
++#define ByteOrder		X_LITTLE_ENDIAN
+ #elif defined(PpcArchitecture) || defined(Ppc64Architecture)
+ #define ByteOrder		X_BIG_ENDIAN
+ #elif defined(HPArchitecture)
diff -Nru xutils-dev-7.7+3/debian/patches/series xutils-dev-7.7+3ppc64el1/debian/patches/series
--- xutils-dev-7.7+3/debian/patches/series	2014-05-21 16:00:54.000000000 -0300
+++ xutils-dev-7.7+3ppc64el1/debian/patches/series	2014-10-14 10:45:02.000000000 -0300
@@ -3,3 +3,5 @@
 05_xaw_without_xp.diff
 06_font_path.diff
 07_gnu_manpath.diff
+98_ppc64el-not-ld-options.diff
+99_ppc64el.diff

Reply to: