Bug#775321: x32 port

2017-07-06 Thread Thorsten Glaser
On Tue, 20 Jan 2015, Mike Hommey wrote:

> What is the x32 function call convention? is it the same as x86? if it

No, it differs, it’s almost the same as amd64 though.

Is there anything I can do to jump in and help, at this point?

Thanks,
//mirabilos, who recently discovered firefox-esr works better than
Mozilla’s i386 binaries which he had been using for a while,
*and* that they have ALSA support, which is a must

PS: Please keep me in Cc.
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg



Bug#775321: x32 port

2015-01-19 Thread Adam Borowski
On Wed, Jan 14, 2015 at 01:33:18PM +0900, Mike Hommey wrote:
 That means the xpcshell is broken in some way which means iceweasel is
 likely to be broken as well.

xpcshell passed both whatever tests are done during the build, and my sanity
checks, yet it fails on xpconnect.  Iceweasel gives more useful data when
ran under gdb:

Program received signal SIGSEGV, Segmentation fault.
0xce572460 in ?? ()
(gdb) bt
#0  0xce572460 in ?? ()
#1  0xf2f57de0 in NS_InvokeByIndex (that=optimized out, 
methodIndex=optimized out, 
paramCount=optimized out, params=optimized out)
at 
/home/kilobyte/tmp/x32/iceweasel-35.0/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:164
#2  0xf329fe91 in Invoke (this=0xa848)
at 
/home/kilobyte/tmp/x32/iceweasel-35.0/js/xpconnect/src/XPCWrappedNative.cpp:2396
[...]

So it turns out the xptcall part requires specific support for every
architecture.  I'm afraid I can't port this part myself (the last time I
did serious assembler was 8086...).  I wonder who could help...


 Or that you can't run x32 binaries on your build host.

I'm porting this (and everything else) natively.  Mostly in a chroot, as for
proper dogfooding one would want, you know, a proper browser...


Meow!
-- 
// If you believe in so-called intellectual property, please immediately
// cease using counterfeit alphabets.  Instead, contact the nearest temple
// of Amon, whose priests will provide you with scribal services for all
// your writing needs, for Reasonable and Non-Discriminatory prices.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#775321: x32 port

2015-01-19 Thread Mike Hommey
On Tue, Jan 20, 2015 at 04:51:05AM +0100, Adam Borowski wrote:
 On Wed, Jan 14, 2015 at 01:33:18PM +0900, Mike Hommey wrote:
  That means the xpcshell is broken in some way which means iceweasel is
  likely to be broken as well.
 
 xpcshell passed both whatever tests are done during the build, and my sanity
 checks, yet it fails on xpconnect.  Iceweasel gives more useful data when
 ran under gdb:
 
 Program received signal SIGSEGV, Segmentation fault.
 0xce572460 in ?? ()
 (gdb) bt
 #0  0xce572460 in ?? ()
 #1  0xf2f57de0 in NS_InvokeByIndex (that=optimized out, 
 methodIndex=optimized out, 
 paramCount=optimized out, params=optimized out)
 at 
 /home/kilobyte/tmp/x32/iceweasel-35.0/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:164
 #2  0xf329fe91 in Invoke (this=0xa848)
 at 
 /home/kilobyte/tmp/x32/iceweasel-35.0/js/xpconnect/src/XPCWrappedNative.cpp:2396
 [...]
 
 So it turns out the xptcall part requires specific support for every
 architecture.  I'm afraid I can't port this part myself (the last time I
 did serious assembler was 8086...).  I wonder who could help...

What is the x32 function call convention? is it the same as x86? if it
is, then just using the x86 xptcall file instead of the x86_64 one would
work. If it's not, then you'll need your own implementation.

Mike


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#775321: x32 port

2015-01-13 Thread Mike Hommey
On Wed, Jan 14, 2015 at 04:51:39AM +0100, Adam Borowski wrote:
 Package: iceweasel
 Version: 34.0-1
 Severity: wishlist
 Tags: patch
 User: debian-...@lists.debian.org
 Usertags: port-x32 ftbfs-x32
 
 Hi!
 Here's a set of patches to port iceweasel to the x32 architecture.  They
 _almost_ work -- the build fails trying to access non-existant
 '/tmp/tmpjUZb3o.zip' during final install stage, log at:
 http://angband.pl/tmp/iceweasel_34.0-1+x32_x32-20150114-0216.build

That means the xpcshell is broken in some way, which means iceweasel is
likely to be broken as well.
Or that you can't run x32 binaries on your build host.

Mike


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#775321: x32 port

2015-01-13 Thread Adam Borowski
Package: iceweasel
Version: 34.0-1
Severity: wishlist
Tags: patch
User: debian-...@lists.debian.org
Usertags: port-x32 ftbfs-x32

Hi!
Here's a set of patches to port iceweasel to the x32 architecture.  They
_almost_ work -- the build fails trying to access non-existant
'/tmp/tmpjUZb3o.zip' during final install stage, log at:
http://angband.pl/tmp/iceweasel_34.0-1+x32_x32-20150114-0216.build
but as 35.0 has been released today, I think it's better to submit what
I got.  The failure might be even unrelated to the port...

The patches can be concatenated into one, I'm submitting them split
into tiny bits.  The order is irrelevant.
Description: Get rid of sysctl includes
 The sysctl syscall has been strongly deprecated on Linux for ages and is
 not present at all on new architectures.  We don't use it anymore, but
 one #include was left.  This patch gets rid of it on platforms that don't
 use sysctl (ie, any but BSD).  This unbreaks x32 and possibly others.
Author: Adam Borowski kilob...@angband.pl

--- iceweasel-34.0.orig/memory/mozjemalloc/jemalloc.c
+++ iceweasel-34.0/memory/mozjemalloc/jemalloc.c
@@ -325,7 +325,7 @@ __FBSDID($FreeBSD: head/lib/libc/stdlib
 #endif
 #include sys/time.h
 #include sys/types.h
-#if !defined(MOZ_MEMORY_SOLARIS)  !defined(MOZ_MEMORY_ANDROID)
+#if defined(MOZ_MEMORY_BSD)
 #include sys/sysctl.h
 #endif
 #include sys/uio.h
--- iceweasel-34.0.orig/media/mtransport/third_party/nICEr/src/stun/addrs.c
+++ iceweasel-34.0/media/mtransport/third_party/nICEr/src/stun/addrs.c
@@ -45,7 +45,9 @@
 #include sys/param.h
 #include sys/socket.h
 #ifndef ANDROID
+#if defined(BSD) || defined(DARWIN)
 #include sys/sysctl.h
+#endif
 #include sys/syslog.h
 #else
 #include syslog.h
Description: Trust __LP64__ on GNUC.
 Use __LP64__ to detect 64 bit systems, rather than trying to infer that
 from processor type.  This broke __x86_64__ in 32-bit mode (aka x32).
Author: Adam Borowski kilob...@angband.pl

--- iceweasel-34.0.orig/js/src/jstypes.h
+++ iceweasel-34.0/js/src/jstypes.h
@@ -141,8 +141,7 @@
 # endif
 #elif defined(__GNUC__)
 /* Additional GCC defines are when running on Solaris, AIX, and HPUX */
-# if defined(__x86_64__) || defined(__sparcv9) || \
-defined(__64BIT__) || defined(__LP64__)
+# if defined(__sparcv9) || defined(__64BIT__) || defined(__LP64__)
 #  define JS_64BIT
 # endif
 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */
Description: Disable breakpad on x32.
 While x32 is not supported, breakpad mistakes it for amd64 (as both share
 the same processor type).  This patch fixes the detection.
 .
 The profiler depends on breakpad, so it has to be disabled as well.
Author: Adam Borowski kilob...@angband.pl

--- iceweasel-34.0.orig/configure.in
+++ iceweasel-34.0/configure.in
@@ -1651,6 +1651,9 @@ Linux)
 *)
 MOZ_ENABLE_PROFILER_SPS=
 esac
+case $target in
+x86_64-*linux-gnux32)  MOZ_ENABLE_PROFILER_SPS=
+esac
 ;;
 WINNT|Darwin) ;;
 *)
@@ -5929,6 +5932,10 @@ dnl = Breakpad crash reporting (on by de
 dnl 
 
 case $target in
+x86_64-*linux-gnux32*)   
+  # x32 is not supported.
+  MOZ_CRASHREPORTER=
+  ;;
 i?86-*-mingw*|x86_64-*-mingw*)
   MOZ_CRASHREPORTER=1
   ;;
--- iceweasel-34.0.orig/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+++ iceweasel-34.0/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
@@ -85,7 +85,8 @@
 /* We currently only support x86-32, x86-64, ARM, MIPS, and PPC on Linux.
  * Porting to other related platforms should not be difficult.
  */
-#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) ||   \
+#if (defined(__i386__) || defined(__x86_64__)  defined(__LP64__) \
+ || defined(__ARM_ARCH_3__) ||   \
  defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__)) \
(defined(__linux) || defined(__ANDROID__))
 
Description: Disable jpegturbo optimizations on x32.
 While assembly code in jpegturbo is usable on both amd64 and x32, yasm can't
 produce elfx32 objects.
Author: Adam Borowski kilob...@angband.pl
--- iceweasel-34.0.orig/configure.in
+++ iceweasel-34.0/configure.in
@@ -6045,10 +6045,17 @@ if test -n $MOZ_LIBJPEG_TURBO; then
 fi
   ;;
   *:x86_64)
-if $CC -E -dM -/dev/null | grep -q __ELF__; then
-  LIBJPEG_TURBO_ASFLAGS=-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF
-  LIBJPEG_TURBO_X64_ASM=1
-fi
+case $target in
+*-gnux32)
+  # yasm doesn't support elfx32.
+  ;;
+*)
+  if $CC -E -dM -/dev/null | grep -q __ELF__; then
+LIBJPEG_TURBO_ASFLAGS=-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF
+LIBJPEG_TURBO_X64_ASM=1
+  fi
+  ;;
+esac
   ;;
   esac
 
Description: Disable the js JIT on x32.
Author: Adam Borowski kilob...@angband.pl
--- iceweasel-34.0.orig/js/src/configure.in
+++ iceweasel-34.0/js/src/configure.in
@@ -1998,6 +1998,8 @@ fi
 dnl Configure JIT support
 
 case $target in