FS#54843 - [dmd] Instructions on how to build libphobos2.a of dmd with PIE=1

Attached to Project: Community Packages
Opened by Marcy Latham (sexyshortages) - Monday, 17 July 2017, 01:53 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 17 July 2017, 02:06 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

As the dmd package is still broken due to the PIE changes, here's a step-by-step guide to fix it.
Please let me know if you have questions or need more detailed instructions.
Thanks!

1) dmd.conf

Add -fPIC like on the official config:

https://github.com/dlang/dmd/blob/master/ini/linux/bin64/dmd.conf

2) Fix your host compiler, e.g.

source $(curl https://i.dlang.io | bash -s dmd-2.075.0-rc1 -a)

Or grab the properly built binaries here: http://dlang.org/download.html

3) Set PIC=1 at the PKGBUILD

--- PKGBUILD 2017-07-17 03:40:06.755422923 +0200
+++ PKGBUILD.old 2017-07-17 03:13:33.000000000 +0200
@@ -9,16 +9,15 @@
pkgdesc="D programming language compiler and standard library"
groups=('dlang' 'dlang-dmd')
pkgbase=dmd
pkgver=2.074.1
pkgrel=1
epoch=1
arch=('i686' 'x86_64')
url="http://www.dlang.org"
makedepends=('git' 'gcc' 'make' 'dmd' 'libphobos-devel')
sha256sums=('SKIP'
'SKIP'
@@ -34,10 +33,10 @@
make -f posix.mak MODEL=$_archbits RELEASE=1

cd $srcdir/druntime
- make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1 PIC=1
+ make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1

cd $srcdir/phobos
- make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1 PIC=1
+ make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1
}

package_dmd() {
@@ -62,7 +61,8 @@
cp -r $srcdir/dmd/docs/man/man1/* $pkgdir/usr/share/man/man1/
cp -r $srcdir/dmd/docs/man/man5/* $pkgdir/usr/share/man/man5/

- install -Dm644 $srcdir/dmd/LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE
+ install -Dm644 $srcdir/dmd/src/ddmd/backendlicense.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE-backend
+ install -Dm644 $srcdir/dmd/src/ddmd/boostlicense.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE-frontend

mkdir -p $pkgdir/usr/share/d/samples/
cp -r $srcdir/dmd/samples/* $pkgdir/usr/share/d/samples/
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Monday, 17 July 2017, 02:06 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#54749  and this should already work, stop opening frivolous duplicates either way

Loading...