Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 93 - Build fails on ARM with static assert 8u == 4u
Summary: Build fails on ARM with static assert 8u == 4u
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: libgphobos (show other bugs)
Version: 4.8.x
Hardware: ARM Linux
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-01-21 14:11 CET by King_DuckZ
Modified: 2014-02-13 08:03 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description King_DuckZ 2014-01-21 14:11:31 CET
I'm at commit c4194221701084a31b8b28a54f20339a80fb50a7, configuring with:

../gcc-4.8.2/configure --with-bugurl="http://gdcproject.org/bugzilla" --enable-languages=d --prefix=/opt/gdc --enable-shared --enable-linker-build-id --with-system-zlib --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --enable-checking=release --enable-gold

the build fails on both Raspberry Pi and Utilite Pro with the following assertion failure:

/home/duckz/dev/thirdparty/gdc_compiler/gcc-4.8.2/libphobos/libdruntime/gcc/deh.d:116: error: static assert  (8u == 4u) is false
Comment 1 Iain Buclaw 2014-02-02 15:38:13 CET
I've got a fix locally for this, somewhere in the realm of:

---
-  // To place 'obj' behing unwindHeader.
-  enum UNWIND_PAD = (Phase1Info.sizeof + Object.sizeof)
-    % _Unwind_Exception.alignof;
+  // The object being thrown.  Like GCJ, the compiled code expects this to 
+  // be immediately before the generic exception header.
+  enum UNWIND_PAD = (Object.alignof < _Unwind_Exception.alignof)
+    ? _Unwind_Exception.alignof - Object.alignof : 0;

-  static if (UNWIND_PAD > 0)
-    byte[UNWIND_PAD] _pad;
+  ubyte[UNWIND_PAD] pad;
---