Package: libgc
Version: 7.2d-6
Followup-For: Bug #732349
User: debian-...@lists.debian.org
Usertag: arm64

This patch expands on the basic autoconf patch in the initial bug report.

Aplying that patch configures for arm64 and tries to build for it, but
fails due to not actually having internal support:

Attached is a full patch which also adds aarch64/arm64 support to the gcconfig 
file,
based on the ubuntu patch at:
http://patches.ubuntu.com/libg/libgc/libgc_1:7.2d-5ubuntu2.patch

It also enables the pthreads library as otherwise the test target
fails. I'm not sure why it aparently builds on other arches without
this. Something to do with defaults I guess, but some investigation has
made me none the wiser.

Please upload this patch as soon as you can as libgc blocks core
packages like base-passwd on the arm64 port.

I am happy to do an NMU for you if you prefer.

-- System Information:
Debian Release: 7.5
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-kvm-i386-20110111 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -Nru libgc-7.2d/debian/changelog libgc-7.2d/debian/changelog
--- libgc-7.2d/debian/changelog	2013-12-23 11:49:36.000000000 +0000
+++ libgc-7.2d/debian/changelog	2014-05-20 19:35:52.000000000 +0000
@@ -1,3 +1,11 @@
+libgc (1:7.2d-6+arm64) unreleased; urgency=low
+
+  * Non-maintainer upload.
+  * autoreconf to support new ports
+  * Add aarch64/arm64 support: gcconfig.h and symbols file
+
+ -- Wookey <woo...@debian.org>  Thu, 17 Apr 2014 16:25:03 +0000
+
 libgc (1:7.2d-6) unstable; urgency=medium
 
   * Run full autoreconf during build
diff -Nru libgc-7.2d/debian/control libgc-7.2d/debian/control
--- libgc-7.2d/debian/control	2013-12-23 11:28:03.000000000 +0000
+++ libgc-7.2d/debian/control	2014-05-20 19:46:58.000000000 +0000
@@ -3,7 +3,8 @@
 Section: libs
 Priority: standard
 Build-Depends: debhelper (>= 9),
- autoconf,
+ dh-autoreconf,
+ autotools-dev,
  libatomic-ops-dev (>= 7.3~),
  pkg-config,
  pkg-kde-tools
diff -Nru libgc-7.2d/debian/libgc1c2.symbols libgc-7.2d/debian/libgc1c2.symbols
--- libgc-7.2d/debian/libgc1c2.symbols	2013-12-23 11:45:23.000000000 +0000
+++ libgc-7.2d/debian/libgc1c2.symbols	2014-05-20 19:34:47.000000000 +0000
@@ -84,7 +84,7 @@
  GC_core_malloc@Base 1:7.2d
  GC_core_malloc_atomic@Base 1:7.2d
  GC_current_warn_proc@Base 1:7.2d
- (arch=!kfreebsd-amd64 !kfreebsd-i386 !mips !mipsel !s390 !s390x !sparc !sparc64)GC_data_start@Base 1:7.2d
+ (arch=!arm64 !kfreebsd-amd64 !kfreebsd-i386 !mips !mipsel !s390 !s390x !sparc !sparc64)GC_data_start@Base 1:7.2d
  GC_debug_change_stubborn@Base 1:7.2d
  GC_debug_end_stubborn_change@Base 1:7.2d
  GC_debug_free@Base 1:7.2d
@@ -159,7 +159,7 @@
  GC_ext_descriptors@Base 1:7.2d
  GC_extend_size_map@Base 1:7.2d
  GC_fail_count@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_fault_handler@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_fault_handler@Base 1:7.2d
  (arch=alpha amd64 i386 ia64 m68k x32)GC_fault_handler_lock@Base 1:7.2d
  GC_finalize@Base 1:7.2d
  GC_finalize_all@Base 1:7.2d
@@ -168,8 +168,8 @@
  GC_finalizer_notifier@Base 1:7.2d
  GC_find_header@Base 1:7.2d
  GC_find_leak@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_find_limit@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_find_limit_with_bound@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_find_limit@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_find_limit_with_bound@Base 1:7.2d
  GC_findleak_delay_free@Base 1:7.2d
  GC_finish_collection@Base 1:7.2d
  GC_fo_entries@Base 1:7.2d
@@ -265,7 +265,7 @@
  GC_init_explicit_typing@Base 1:7.2d
  GC_init_gcj_malloc@Base 1:7.2d
  GC_init_headers@Base 1:7.2d
- (arch=!kfreebsd-amd64 !kfreebsd-i386 !mips !mipsel !s390 !s390x !sparc !sparc64)GC_init_linux_data_start@Base 1:7.2d
+ (arch=!arm64 !kfreebsd-amd64 !kfreebsd-i386 !mips !mipsel !s390 !s390x !sparc !sparc64)GC_init_linux_data_start@Base 1:7.2d
  GC_init_parallel@Base 1:7.2d
  GC_init_size_map@Base 1:7.2d
  GC_init_thread_local@Base 1:7.2d
@@ -286,7 +286,7 @@
  GC_is_visible@Base 1:7.2d
  GC_is_visible_print_proc@Base 1:7.2d
  GC_java_finalization@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_jmp_buf@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_jmp_buf@Base 1:7.2d
  (arch=armel armhf hurd-i386)GC_key_create@Base 1:7.2d
  GC_large_alloc_warn_interval@Base 1:7.2d
  GC_large_alloc_warn_suppressed@Base 1:7.2d
@@ -477,7 +477,7 @@
  (arch=armel armhf hurd-i386)GC_remove_specific@Base 1:7.2d
  GC_remove_tmp_roots@Base 1:7.2d
  (arch=!hurd-i386 !kfreebsd-amd64 !kfreebsd-i386)GC_repeat_read@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_reset_fault_handler@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_reset_fault_handler@Base 1:7.2d
  GC_reset_finalizer_nested@Base 1:7.2d
  GC_restart_handler@Base 1:7.2d
  GC_retry_signals@Base 1:7.2d
@@ -515,7 +515,7 @@
  GC_set_warn_proc@Base 1:7.2d
  GC_setpagesize@Base 1:7.2d
  (arch=armel armhf hurd-i386)GC_setspecific@Base 1:7.2d
- (arch=!mips !mipsel !s390 !s390x)GC_setup_temporary_fault_handler@Base 1:7.2d
+ (arch=!arm64 !mips !mipsel !s390 !s390x)GC_setup_temporary_fault_handler@Base 1:7.2d
  GC_should_collect@Base 1:7.2d
  GC_should_invoke_finalizers@Base 1:7.2d
  GC_signal_mark_stack_overflow@Base 1:7.2d
@@ -582,7 +582,7 @@
 libgccpp.so.1 libgc1c2 #MINVER#
  _ZdaPv@Base 1:7.2d
  _ZdlPv@Base 1:7.2d
- (subst)_Zna{size_t}@Base 1:7.2d
- (subst)_Znw{size_t}@Base 1:7.2d
+ (arch=!arm64|subst)_Zna{size_t}@Base 1:7.2d
+ (arch=!arm64|subst)_Znw{size_t}@Base 1:7.2d
  (arch=sparc sparc64)_etext@Base 1:7.2d
  (arch=kfreebsd-amd64 kfreebsd-i386)etext@Base 1:7.2d
diff -Nru libgc-7.2d/debian/patches/arm64.diff libgc-7.2d/debian/patches/arm64.diff
--- libgc-7.2d/debian/patches/arm64.diff	1970-01-01 00:00:00.000000000 +0000
+++ libgc-7.2d/debian/patches/arm64.diff	2014-05-20 19:06:36.000000000 +0000
@@ -0,0 +1,70 @@
+Index: libgc-7.2d/include/private/gcconfig.h
+===================================================================
+--- libgc-7.2d.orig/include/private/gcconfig.h
++++ libgc-7.2d/include/private/gcconfig.h
+@@ -70,6 +70,13 @@
+ #    define I386
+ #    define mach_type_known
+ # endif
++#if defined(__aarch64__)
++#    define AARCH64
++#    if !defined(LINUX)
++#      define NOSYS
++#      define mach_type_known
++#    endif
++# endif
+ # if defined(__arm) || defined(__arm__) || defined(__thumb__)
+ #    define ARM32
+ #    if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) \
+@@ -250,6 +257,10 @@
+ #    define IA64
+ #    define mach_type_known
+ # endif
++# if defined(LINUX) && defined(__aarch64__)
++#    define AARCH64
++#    define mach_type_known
++# endif
+ # if defined(LINUX) && (defined(__arm) || defined(__arm__))
+ #    define ARM32
+ #    define mach_type_known
+@@ -541,6 +552,7 @@
+                     /*                  running Amdahl UTS4             */
+                     /*             S390       ==> 390-like machine      */
+                     /*                  running LINUX                   */
++                    /*             AARCH64    ==> ARM AArch64           */
+                     /*             ARM32      ==> Intel StrongARM       */
+                     /*             IA64       ==> Intel IPF             */
+                     /*                            (e.g. Itanium)        */
+@@ -1903,6 +1915,32 @@
+ #   endif
+ # endif
+ 
++# ifdef AARCH64
++#   define CPP_WORDSZ 64
++#   define MACH_TYPE "AARCH64"
++#   define ALIGNMENT 8
++#   ifndef HBLKSIZE
++#     define HBLKSIZE 4096
++#   endif
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++#     define LINUX_STACKBOTTOM
++#     define USE_GENERIC_PUSH_REGS
++#     define DYNAMIC_LOADING
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern char _end[];
++#     define DATAEND ((ptr_t)(&_end))
++#   endif
++#   ifdef NOSYS
++      /* __data_start is usually defined in the target linker script.   */
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++      extern void *__stack_base__;
++#     define STACKBOTTOM ((ptr_t)__stack_base__)
++#   endif
++# endif
++
+ # ifdef ARM32
+ #   define CPP_WORDSZ 32
+ #   define MACH_TYPE "ARM32"
diff -Nru libgc-7.2d/debian/patches/series libgc-7.2d/debian/patches/series
--- libgc-7.2d/debian/patches/series	2013-12-23 11:25:50.000000000 +0000
+++ libgc-7.2d/debian/patches/series	2014-05-20 19:05:31.000000000 +0000
@@ -5,3 +5,4 @@
 #05-s390-includes.diff
 enable-threads.diff
 allow-automake-1.13
+arm64.diff
diff -Nru libgc-7.2d/debian/rules libgc-7.2d/debian/rules
--- libgc-7.2d/debian/rules	2013-12-23 11:28:27.000000000 +0000
+++ libgc-7.2d/debian/rules	2014-05-20 19:43:40.000000000 +0000
@@ -8,11 +8,12 @@
 LDFLAGS += -pthread
 
 %:
-	dh $@ --with pkgkde_symbolshelper
+	dh $@ --with autotools-dev,autoreconf,pkgkde_symbolshelper
 
 override_dh_auto_configure:
 	[ ! -d libatomic_ops-1.2 ] || mv libatomic_ops-1.2 libatomic_ops-1.2.bak
 	autoconf
+	EXTRA_TEST_LIBS="-lpthread" \
 	./configure \
 		$(CONFIG_OPTS) \
 		--enable-cplusplus \
@@ -27,11 +28,10 @@
 		--build=$(DEB_BUILD_GNU_TYPE) \
 		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)
 
-override_dh_autoreconf:
-	dh_autoreconf ./autogen.sh
-
 override_dh_auto_test:
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
 	$(MAKE) check
+endif
 
 override_dh_install:
 	install -D doc/gc.man debian/tmp/usr/share/man/man3/gc_malloc.3

Reply via email to