Code Monkey home page Code Monkey logo

Comments (1)

drawkula avatar drawkula commented on July 18, 2024

@vegax87 ... I get GDC built but not it's libs.

Read this as cheatsheet, don't run it as script... some paths need to be changed for your system. CHEATSHEET-4.9:

##
## GDC/Installation/Generic
##
## https://wiki.dlang.org/GDC/Installation/Generic
##

opkg install gcc libmpc libmpfr libgmp autoconf automake flex bison patch git

mkdir -p /opt/gdc/src
cd /opt/gdc/src

tar zxf /src/third-party/src/gcc-4.9.2.tar.gz 
cd gcc-4.9.2
patch -p1 < /src/third-party/build/gcc-4.9.2/gcc-4.9.2.diff 
cd ..

git clone -b gdc-4.9 --single-branch https://github.com/D-Programming-GDC/GDC.git gdc-4.9

cd gdc-4.9
patch -p1 < ../gdc-4.9.diff
./setup-gcc.sh ../gcc-4.9.2
cd ..
mkdir gdc-4.9-build

cd gdc-4.9-build

##
## Building GDC without building Druntime/Phobos
##
## https://wiki.dlang.org/GDC/Installation/Generic#Building_GDC_without_building_Druntime.2FPhobos
##
../gcc-4.9.2/configure --enable-languages=d --disable-bootstrap --prefix=/opt/gdc --with-bugurl=http://bugzilla.gdcproject.org --enable-checking=yes --disable-libphobos

make | tee build.log
make install

gdc-4.9.diff:

diff --git a/gcc/d/dfrontend/object.h b/gcc/d/dfrontend/object.h
index 2474223..2e59c78 100644
--- a/gcc/d/dfrontend/object.h
+++ b/gcc/d/dfrontend/object.h
@@ -10,7 +10,7 @@
 #ifndef OBJECT_H
 #define OBJECT_H

-#define POSIX (__linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun)
+#define POSIX (__linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun || __MINOCA__ )

 #if __DMC__
 #pragma once
diff --git a/gcc/d/dfrontend/speller.c b/gcc/d/dfrontend/speller.c
index eba4e9b..e8d61db 100644
--- a/gcc/d/dfrontend/speller.c
+++ b/gcc/d/dfrontend/speller.c
@@ -13,7 +13,7 @@
 #include <assert.h>
 #include <limits.h>

-#if __sun || _MSC_VER
+#if __sun || _MSC_VER || __MINOCA__
 #include <alloca.h>
 #endif

diff --git a/setup-gcc.sh b/setup-gcc.sh
index fd90721..6e0f844 100755
--- a/setup-gcc.sh
+++ b/setup-gcc.sh
@@ -29,24 +29,28 @@ for arg in "$@"; do
 done


-# 0. Find out what GCC version this is
-if grep version_string $d_gccsrc/gcc/version.c | grep -q '"3.4'; then
-    gcc_ver=3.4
-elif grep version_string $d_gccsrc/gcc/version.c | grep -q '"4.0'; then
-    gcc_ver=4.0
-elif grep -q -E '^4\.[1-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
-    gcc_ver=$(grep -oh -E '^4\.[0-9]+|$' $d_gccsrc/gcc/BASE-VER)
-elif grep -q -E '^5\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
-    gcc_ver=5
-elif grep -q -E '^6\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
-    gcc_ver=6
-elif grep -q -E '^7\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
-    gcc_ver=7
-else echo "cannot get gcc version"
-    exit 1
-fi
-echo "found gcc version $gcc_ver"
-gcc_patch_key=${gcc_ver}.x
+## 0. Find out what GCC version this is
+#if grep version_string $d_gccsrc/gcc/version.c | grep -q '"3.4'; then
+#    gcc_ver=3.4
+#elif grep version_string $d_gccsrc/gcc/version.c | grep -q '"4.0'; then
+#    gcc_ver=4.0
+#elif grep -q -E '^4\.[1-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
+#    gcc_ver=$(grep -oh -E '^4\.[0-9]+|$' $d_gccsrc/gcc/BASE-VER)
+#elif grep -q -E '^5\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
+#    gcc_ver=5
+#elif grep -q -E '^6\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
+#    gcc_ver=6
+#elif grep -q -E '^7\.[0-9]+([^0-9]|$)' $d_gccsrc/gcc/BASE-VER; then
+#    gcc_ver=7
+#else echo "cannot get gcc version"
+#    exit 1
+#fi
+#echo "found gcc version $gcc_ver"
+#gcc_patch_key=${gcc_ver}.x
+
+## the above failed due to no "-o" in minoca's grep.
+## for 1st tests hardcoding the version
+gcc_patch_key=4.9.x

 # 1. Determine if this version of GCC is supported
 if test ! -f "gcc/d/patches/patch-gcc-$gcc_patch_key"; then

Houston, we have some results:

(root@minoca:pty19)/opt/gdc/bin# ls -l
total 17312
-rwxr-xr-x  1 root root  2308138 Nov 17 12:23 cpp
-rwxr-xr-x  1 root root  2306134 Nov 17 12:23 gcc
-rwxr-xr-x  1 root root    97013 Nov 17 12:23 gcc-ar
-rwxr-xr-x  1 root root    96957 Nov 17 12:23 gcc-nm
-rwxr-xr-x  1 root root    96969 Nov 17 12:23 gcc-ranlib
-rwxr-xr-x  1 root root  1507565 Nov 17 12:23 gcov
-rwxr-xr-x  1 root root  2311749 Nov 17 12:23 gdc
lrwxr-xr-x  1 root root        3 Nov 17 12:23 i686-pc-minoca-gcc -> gcc
lrwxr-xr-x  1 root root        3 Nov 17 12:23 i686-pc-minoca-gcc-4.9.2 -> gcc
lrwxr-xr-x  1 root root        6 Nov 17 12:23 i686-pc-minoca-gcc-ar -> gcc-ar
lrwxr-xr-x  1 root root        6 Nov 17 12:23 i686-pc-minoca-gcc-nm -> gcc-nm
lrwxr-xr-x  1 root root       10 Nov 17 12:23 i686-pc-minoca-gcc-ranlib -> gcc-ranlib
lrwxr-xr-x  1 root root        3 Nov 17 12:23 i686-pc-minoca-gdc -> gdc

Someone knowing more about GDC should take over now removing --disable-libphobos and looking at the resulting errors.

from os.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.