Date: Tuesday, May 22, 2012 @ 14:01:41
  Author: foutrelis
Revision: 159362

Fix FS#29951: [llvm] Produces broken host triple configuration in a multilib 
environment under 32 bits.

Added:
  llvm/trunk/llvm-Config-config.h
  llvm/trunk/llvm-Config-llvm-config.h
Modified:
  llvm/trunk/PKGBUILD

---------------------------+
 PKGBUILD                  |   14 ++++++++++++++
 llvm-Config-config.h      |    9 +++++++++
 llvm-Config-llvm-config.h |    9 +++++++++
 3 files changed, 32 insertions(+)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2012-05-22 17:00:00 UTC (rev 159361)
+++ PKGBUILD    2012-05-22 18:01:41 UTC (rev 159362)
@@ -18,12 +18,16 @@
 makedepends=('libffi' 'python2' 'ocaml')
 source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.gz
         http://llvm.org/releases/$pkgver/clang-$pkgver.src.tar.gz
+        llvm-Config-config.h
+        llvm-Config-llvm-config.h
         clang-plugin-loader-registry.patch
         cindexer-clang-path.patch
         clang-pure64.patch
         enable-lto.patch)
 sha256sums=('1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab'
             'ff63e215dcd3e2838ffdea38502f8d35bab17e487f3c3799579961e452d5a786'
+            '312574e655f9a87784ca416949c505c452b819fad3061f2cde8aced6540a19a3'
+            '597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48'
             'a0a4494f2a692789670be37fd390906dcaa37b1824f740bdaaea21182f2f3a9c'
             '3074df5322900e087377a8e03a02115463ccc0011c25917c2f06df11facd9b92'
             '288a82fbff17bc554f5863734246500e637882af33ee8511019d5e0d6cd20524'
@@ -139,6 +143,16 @@
   install -d "$pkgdir/usr/lib/bfd-plugins"
   ln -s ../llvm/LLVMgold.so "$pkgdir/usr/lib/bfd-plugins/LLVMgold.so"
 
+  if [[ $CARCH == x86_64 ]]; then
+    # Needed for multilib (https://bugs.archlinux.org/task/29951)
+    # Header stubs are taken from Fedora
+    for _header in config llvm-config; do
+      mv "$pkgdir/usr/include/llvm/Config/$_header"{,-64}.h
+      cp "$srcdir/llvm-Config-$_header.h" \
+        "$pkgdir/usr/include/llvm/Config/$_header.h"
+    done
+  fi
+
   install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 

Added: llvm-Config-config.h
===================================================================
--- llvm-Config-config.h                                (rev 0)
+++ llvm-Config-config.h        2012-05-22 18:01:41 UTC (rev 159362)
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "config-32.h"
+#elif __WORDSIZE == 64
+#include "config-64.h"
+#else
+#error "Unknown word size"
+#endif

Added: llvm-Config-llvm-config.h
===================================================================
--- llvm-Config-llvm-config.h                           (rev 0)
+++ llvm-Config-llvm-config.h   2012-05-22 18:01:41 UTC (rev 159362)
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif

Reply via email to