www.digitalmars.com         C & C++   DMDScript  

D.gnu - Building an ARM cross compiler

reply "Johannes Pfau" <spam example.com> writes:
Hi, has anyone successfully built an arm cross compiler yet?
GCC: 4.4.5 GDC: Latest D2 (r357)

I always get the following error:
-----------------------------------------------------------------
i686-pc-linux-gnu-gcc  -O2 -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -=
W  =

-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  =

-Wcast-qual    -DHAVE_CONFIG_H -I. -Id -I../../gcc-4.4.5-build/gcc  =

-I../../gcc-4.4.5-build/gcc/d -I../../gcc-4.4.5-build/gcc/../include  =

-I../../gcc-4.4.5-build/gcc/../libcpp/include   =

-I../../gcc-4.4.5-build/gcc/../libdecnumber  =

-I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =

-I/include -DCLOOG_PPL_BACKEND   -I. -Id -I../../gcc-4.4.5-build/gcc  =

-I../../gcc-4.4.5-build/gcc/d -I../../gcc-4.4.5-build/gcc/../include  =

-I../../gcc-4.4.5-build/gcc/../libcpp/include   =

-I../../gcc-4.4.5-build/gcc/../libdecnumber  =

-I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =

-I/include -DCLOOG_PPL_BACKEND  -I../../gcc-4.4.5-build/gcc/d  =

-I../../gcc-4.4.5-build/gcc/d/dmd2 -Id -D_GNU_SOURCE=3D1 -D_DH=3D1  =

-DD_NO_TRAMPOLINES=3D1 -DELFOBJ=3D1 -DLIBPHOBOS=3D\"-lgphobos2\"  =

-DLIBPHOBOS_PROFILE=3D\"-lgphobos2\" -DLIBDRUNTIME=3D\"-lgdruntime\"  =

-DLIBDRUNTIME_PROFILE=3D\"-lgdruntime\" -DD_GCC_VER=3D44 -Wno-missing-br=
aces  =

-fmessage-length=3D0 -o d/d-c-stubs.cglue.o -c  =

../../gcc-4.4.5-build/gcc/d/d-c-stubs.c
i686-pc-linux-gnu-g++  -O2 -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -=
W  =

-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qu=
al  =

-Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic=
  =

-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings    =

-DHAVE_CONFIG_H -I. -I. -I../../gcc-4.4.5-build/gcc  =

-I../../gcc-4.4.5-build/gcc/. -I../../gcc-4.4.5-build/gcc/../include  =

-I../../gcc-4.4.5-build/gcc/../libcpp/include   =

-I../../gcc-4.4.5-build/gcc/../libdecnumber  =

-I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =

-I/include -DCLOOG_PPL_BACKEND   -I. -I. -I../../gcc-4.4.5-build/gcc  =

-I../../gcc-4.4.5-build/gcc/. -I../../gcc-4.4.5-build/gcc/../include  =

-I../../gcc-4.4.5-build/gcc/../libcpp/include   =

-I../../gcc-4.4.5-build/gcc/../libdecnumber  =

-I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =

-I/include -DCLOOG_PPL_BACKEND  -I../../gcc-4.4.5-build/gcc/d  =

-I../../gcc-4.4.5-build/gcc/d/dmd2 -Id -D_GNU_SOURCE=3D1 -D_DH=3D1  =

-DD_NO_TRAMPOLINES=3D1 -DELFOBJ=3D1 -DLIBPHOBOS=3D\"-lgphobos2\"  =

-DLIBPHOBOS_PROFILE=3D\"-lgphobos2\" -DLIBDRUNTIME=3D\"-lgdruntime\"  =

-DLIBDRUNTIME_PROFILE=3D\"-lgdruntime\" -DD_GCC_VER=3D44 -Wno-missing-br=
aces  =

-fmessage-length=3D0 -Wl,--hash-style=3Dgnu -Wl,--as-needed -o cc1d \
		d/id.gen.o d/impcnvtab.gen.o attribs.o cppdefault.o stub-objc.o prefix=
.o  =

arm-c.o gimplify.o tree-iterator.o  d/aav.dmd.o d/access.dmd.o  =

d/aliasthis.dmd.o d/array.dmd.o d/arrayop.dmd.o d/async.dmd.o  =

d/attrib.dmd.o d/cast.dmd.o d/class.dmd.o d/clone.dmd.o d/cond.dmd.o  =

d/constfold.dmd.o d/dchar.dmd.o d/declaration.dmd.o d/delegatize.dmd.o  =

d/doc.dmd.o d/dsymbol.dmd.o d/dump.dmd.o d/entity.dmd.o d/enum.dmd.o  =

d/expression.dmd.o d/func.dmd.o d/gnuc.dmd.o d/hdrgen.dmd.o d/html.dmd.o=
  =

d/identifier.dmd.o d/imphint.dmd.o d/import.dmd.o d/init.dmd.o  =

d/inline.dmd.o d/interpret.dmd.o d/json.dmd.o d/lexer.dmd.o  =

d/lstring.dmd.o d/macro.dmd.o d/mangle.dmd.o d/mars.dmd.o d/mtype.dmd.o =
 =

d/module.dmd.o d/opover.dmd.o d/optimize.dmd.o d/parse.dmd.o d/rmem.dmd.=
o  =

d/root.dmd.o d/scope.dmd.o d/speller.dmd.o d/statement.dmd.o  =

d/staticassert.dmd.o d/stringtable.dmd.o d/struct.dmd.o d/template.dmd.o=
  =

d/todt.dmd.o d/toobj.dmd.o d/typinf.dmd.o d/unialpha.dmd.o d/utf.dmd.o  =

d/unittests.dmd.o d/version.dmd.o d/builtin.dmd.o d/traits.dmd.o  =

d/d-lang.glue.o d/d-decls.glue.o d/d-codegen.glue.o d/d-objfile.glue.o  =

d/d-irstate.glue.o d/d-glue.glue.o d/d-convert.glue.o d/d-todt.glue.o  =

d/d-gcc-real.glue.o d/d-gt.cglue.o d/d-builtins.cglue.o d/d-misc.cglue.o=
  =

d/d-builtins2.glue.o d/symbol.glue.o d/asmstmt.glue.o d/dt.glue.o  =

d/d-cppmngl.glue.o d/d-c-stubs.cglue.o main.o  libbackend.a  =

../libcpp/libcpp.a ../libdecnumber/libdecnumber.a -L/lib -lcloog  -lmpfr=
  =

-lgmp ../libcpp/libcpp.a   ../libiberty/libiberty.a  =

../libdecnumber/libdecnumber.a
arm-c.o: In function `arm_output_c_attributes':
arm-c.c:(.text+0x7): undefined reference to `c_global_trees'
collect2: ld gab 1 als Ende-Status zur=C3=BCck
make[1]: *** [cc1d] Fehler 1
make[1]: Leaving directory  =

`/var/abs/local/cross-arm-elf-gdc2-hg/src/gcc-build/gcc'
make: *** [all-gcc] Fehler 2
-----------------------------------------------------------------
(Sorry about the German error messages, forgot to use LANG=3DC but I thi=
nk  =

the most important part is in English anyway)

As the error message states the c_global_trees symbol is not linked in. =
 =

It's used in arm-c.c and defined in c-common.c. Just linking against  =

c-common.o isn't enough though as c-common needs more object files to be=
  =

linked against.

This seems to be a D frontend related problem, building a gcc c cross  =

compiler works. I tried building a native compiler on the arm machine an=
d  =

that worked (but it's painfully slow), so it's likely a cross compiler  =

only problem.

I used the following script (custom Archlinux PKGBUILD, based on the  =

cross-arm-elf-gcc-base and gdc2-hg PKGBUILDS):
http://pastebin.ca/1992505

-- =

Johannes Pfau
Nov 15 2010
next sibling parent reply Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Johannes Pfau (spam example.com)'s article
 Hi, has anyone successfully built an arm cross compiler yet?
 GCC: 4.4.5 GDC: Latest D2 (r357)
 I always get the following error:
 -----------------------------------------------------------------
 i686-pc-linux-gnu-gcc  -O2 -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -=
 W  =
 -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  =
 -Wcast-qual    -DHAVE_CONFIG_H -I. -Id -I../../gcc-4.4.5-build/gcc  =
 -I../../gcc-4.4.5-build/gcc/d -I../../gcc-4.4.5-build/gcc/../include  =
 -I../../gcc-4.4.5-build/gcc/../libcpp/include   =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber  =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =
 -I/include -DCLOOG_PPL_BACKEND   -I. -Id -I../../gcc-4.4.5-build/gcc  =
 -I../../gcc-4.4.5-build/gcc/d -I../../gcc-4.4.5-build/gcc/../include  =
 -I../../gcc-4.4.5-build/gcc/../libcpp/include   =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber  =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =
 -I/include -DCLOOG_PPL_BACKEND  -I../../gcc-4.4.5-build/gcc/d  =
 -I../../gcc-4.4.5-build/gcc/d/dmd2 -Id -D_GNU_SOURCE=3D1 -D_DH=3D1  =
 -DD_NO_TRAMPOLINES=3D1 -DELFOBJ=3D1 -DLIBPHOBOS=3D\"-lgphobos2\"  =
 -DLIBPHOBOS_PROFILE=3D\"-lgphobos2\" -DLIBDRUNTIME=3D\"-lgdruntime\"  =
 -DLIBDRUNTIME_PROFILE=3D\"-lgdruntime\" -DD_GCC_VER=3D44 -Wno-missing-br=
 aces  =
 -fmessage-length=3D0 -o d/d-c-stubs.cglue.o -c  =
 ../../gcc-4.4.5-build/gcc/d/d-c-stubs.c
 i686-pc-linux-gnu-g++  -O2 -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -=
 W  =
 -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qu=
 al  =
 -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic=
   =
 -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings    =
 -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.4.5-build/gcc  =
 -I../../gcc-4.4.5-build/gcc/. -I../../gcc-4.4.5-build/gcc/../include  =
 -I../../gcc-4.4.5-build/gcc/../libcpp/include   =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber  =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =
 -I/include -DCLOOG_PPL_BACKEND   -I. -I. -I../../gcc-4.4.5-build/gcc  =
 -I../../gcc-4.4.5-build/gcc/. -I../../gcc-4.4.5-build/gcc/../include  =
 -I../../gcc-4.4.5-build/gcc/../libcpp/include   =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber  =
 -I../../gcc-4.4.5-build/gcc/../libdecnumber/dpd -I../libdecnumber   =
 -I/include -DCLOOG_PPL_BACKEND  -I../../gcc-4.4.5-build/gcc/d  =
 -I../../gcc-4.4.5-build/gcc/d/dmd2 -Id -D_GNU_SOURCE=3D1 -D_DH=3D1  =
 -DD_NO_TRAMPOLINES=3D1 -DELFOBJ=3D1 -DLIBPHOBOS=3D\"-lgphobos2\"  =
 -DLIBPHOBOS_PROFILE=3D\"-lgphobos2\" -DLIBDRUNTIME=3D\"-lgdruntime\"  =
 -DLIBDRUNTIME_PROFILE=3D\"-lgdruntime\" -DD_GCC_VER=3D44 -Wno-missing-br=
 aces  =
 -fmessage-length=3D0 -Wl,--hash-style=3Dgnu -Wl,--as-needed -o cc1d \
 		d/id.gen.o d/impcnvtab.gen.o attribs.o cppdefault.o stub-objc.o prefix=
 .o  =
 arm-c.o gimplify.o tree-iterator.o  d/aav.dmd.o d/access.dmd.o  =
 d/aliasthis.dmd.o d/array.dmd.o d/arrayop.dmd.o d/async.dmd.o  =
 d/attrib.dmd.o d/cast.dmd.o d/class.dmd.o d/clone.dmd.o d/cond.dmd.o  =
 d/constfold.dmd.o d/dchar.dmd.o d/declaration.dmd.o d/delegatize.dmd.o  =
 d/doc.dmd.o d/dsymbol.dmd.o d/dump.dmd.o d/entity.dmd.o d/enum.dmd.o  =
 d/expression.dmd.o d/func.dmd.o d/gnuc.dmd.o d/hdrgen.dmd.o d/html.dmd.o=
   =
 d/identifier.dmd.o d/imphint.dmd.o d/import.dmd.o d/init.dmd.o  =
 d/inline.dmd.o d/interpret.dmd.o d/json.dmd.o d/lexer.dmd.o  =
 d/lstring.dmd.o d/macro.dmd.o d/mangle.dmd.o d/mars.dmd.o d/mtype.dmd.o =
  =
 d/module.dmd.o d/opover.dmd.o d/optimize.dmd.o d/parse.dmd.o d/rmem.dmd.=
 o  =
 d/root.dmd.o d/scope.dmd.o d/speller.dmd.o d/statement.dmd.o  =
 d/staticassert.dmd.o d/stringtable.dmd.o d/struct.dmd.o d/template.dmd.o=
   =
 d/todt.dmd.o d/toobj.dmd.o d/typinf.dmd.o d/unialpha.dmd.o d/utf.dmd.o  =
 d/unittests.dmd.o d/version.dmd.o d/builtin.dmd.o d/traits.dmd.o  =
 d/d-lang.glue.o d/d-decls.glue.o d/d-codegen.glue.o d/d-objfile.glue.o  =
 d/d-irstate.glue.o d/d-glue.glue.o d/d-convert.glue.o d/d-todt.glue.o  =
 d/d-gcc-real.glue.o d/d-gt.cglue.o d/d-builtins.cglue.o d/d-misc.cglue.o=
   =
 d/d-builtins2.glue.o d/symbol.glue.o d/asmstmt.glue.o d/dt.glue.o  =
 d/d-cppmngl.glue.o d/d-c-stubs.cglue.o main.o  libbackend.a  =
 ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a -L/lib -lcloog  -lmpfr=
   =
 -lgmp ../libcpp/libcpp.a   ../libiberty/libiberty.a  =
 ../libdecnumber/libdecnumber.a
 arm-c.o: In function `arm_output_c_attributes':
 arm-c.c:(.text+0x7): undefined reference to `c_global_trees'
 collect2: ld gab 1 als Ende-Status zur=C3=BCck
 make[1]: *** [cc1d] Fehler 1
 make[1]: Leaving directory  =
 `/var/abs/local/cross-arm-elf-gdc2-hg/src/gcc-build/gcc'
 make: *** [all-gcc] Fehler 2
 -----------------------------------------------------------------
 (Sorry about the German error messages, forgot to use LANG=3DC but I thi=
 nk  =
 the most important part is in English anyway)
 As the error message states the c_global_trees symbol is not linked in. =
  =
 It's used in arm-c.c and defined in c-common.c. Just linking against  =
 c-common.o isn't enough though as c-common needs more object files to be=
   =
 linked against.
 This seems to be a D frontend related problem, building a gcc c cross  =
 compiler works. I tried building a native compiler on the arm machine an=
 d  =
 that worked (but it's painfully slow), so it's likely a cross compiler  =
 only problem.
 I used the following script (custom Archlinux PKGBUILD, based on the  =
 cross-arm-elf-gcc-base and gdc2-hg PKGBUILDS):
 http://pastebin.ca/1992505
 -- =
 Johannes Pfau

There's a patch in Debian which addresses this. Last time I tried (a nice fella allowed me to work via ssh'ing onto a sheevaplug) it mostly works, but you'll need to use the gcstub sources, as the normal gc don't work (2.035~ish time this was I think, so things may have improved since). Regards
Nov 15 2010
next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Iain Buclaw (ibuclaw ubuntu.com)'s article
 There's a patch in Debian which addresses this. Last time I tried (a nice fella
 allowed me to work via ssh'ing onto a sheevaplug) it mostly works, but you'll
need
 to use the gcstub sources, as the normal gc don't work (2.035~ish time this
was I
 think, so things may have improved since).
 Regards

First one fixes your linker errors. I'm not sure whether or not the second is needed for GCC-4.4 (it was for GCC-4.3). --- a/src/gcc/config/arm/arm-c.c 2007-11-05 17:13:46.000000000 +0000 +++ b/src/gcc/config/arm/arm-c.c 2010-08-29 11:42:36.503460693 +0100 -15,7 +15,7 { /* Tag_ABI_PCS_wchar_t. */ asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\n", - (int)(TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT)); + (int)(WCHAR_TYPE_SIZE / BITS_PER_UNIT)); } --- a/src/gcc/d/d-gcc-includes.h 2010-08-19 12:30:20.000000000 +0100 +++ b/src/gcc/d/d-gcc-includes.h 2010-08-23 10:44:15.709788361 +0100 -32,7 +32,11 // hack needed to prevent inclusion of the generated insn-flags.h // which defines some inline functions that use C prototypes.... +// because some archs depend on this header for EH routines, +// only do this if EH_RETURN_HANDLER_RTX is already defined. +#ifdef EH_RETURN_HANDLER_RTX #define GCC_INSN_FLAGS_H +#endif // Conflicting definitions between stdio.h and libiberty.h over the throw() #define HAVE_DECL_ASPRINTF 1
Nov 15 2010
prev sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
== Quote from Johannes Pfau (spam example.com)'s article
 Thanks again Iain,
 I've got a working cross compiler now. The changes for phobos were rather
 small, I'll do some testing whether my changes actually work and if
 everything is fine I'll send those patches to the phobos mailing list.
 The second gcc patch wasn't needed, and the default gc compiled fine. But
 somethings still wrong with the gc, it gets stuck in a loop somewhere.
 With the stub gc things work as they should.

I never said it won't compile. IIRC it source of the problem occurs when entering a certain function in the Gcx class, the parameters passed from the caller are fine, but the callee receives garbage.
 One last question: If I build with --sysroot=/some/path the d include
 files still go to /usr/include/d2/4.4.5/ This could cause conflicts with
 multiple cross-compilers or the local compiler, is this the way it's
 supposed to be?

If I recall correctly, set --includedir=/some/patch, or --prefix=/some/patch Regards
Nov 22 2010
prev sibling next sibling parent "Johannes Pfau" <spam example.com> writes:
Am 15.11.2010, 21:27 Uhr, schrieb Iain Buclaw <ibuclaw ubuntu.com>:

 =3D=3D Quote from Iain Buclaw (ibuclaw ubuntu.com)'s article
 There's a patch in Debian which addresses this. Last time I tried (a =


 nice fella
 allowed me to work via ssh'ing onto a sheevaplug) it mostly works, bu=


 you'll need
 to use the gcstub sources, as the normal gc don't work (2.035~ish tim=


 this was I
 think, so things may have improved since).
 Regards

First one fixes your linker errors. I'm not sure whether or not the =

 second is
 needed for GCC-4.4 (it was for GCC-4.3).

Thanks Ian, I applied the first patch for now. As you said the problem is gone, but = = now I hit another problem: Compilation now fails with -------------------------------------------------- make[3]: Leaving directory = `/var/abs/local/cross-arm-elf-gdc2-hg/src/gcc-build/arm-elf/thumb/libgcc= ' make[2]: Leaving directory = `/var/abs/local/cross-arm-elf-gdc2-hg/src/gcc-build/arm-elf/libgcc' make[1]: Leaving directory = `/var/abs/local/cross-arm-elf-gdc2-hg/src/gcc-build/arm-elf/libgcc' /bin/sh: line 3: cd: arm-elf/libphobos: No such file or directory make: *** [install-target-libphobos] Error 1 -------------------------------------------------- The arm-elf directory exists, but it only contains a libgcc and thumb = folder. I think the phobos sources are not copied correctly when crosscompiling.= In case you're interested: You can get cheap ARM Hardware by buying the = = "seagate dockstar freeagent go". It's possible to ssh into this = device(http://ahsoftware.de/dockstar/) and install debian on = it(http://jeff.doozan.com/debian/). You can get those for ~30$ in the US= , = I got mine for 25=E2=82=AC in Germany, but Prices in Germany went up aga= in. The = Dockstar uses sheevaplug like hardware: 1.2ghz ARM Processor, 128Mb ram,= = 256mb internal NAND. -- = Johannes Pfau
Nov 16 2010
prev sibling next sibling parent "Johannes Pfau" <spam example.com> writes:
Am 15.11.2010, 21:27 Uhr, schrieb Iain Buclaw <ibuclaw ubuntu.com>:

 == Quote from Iain Buclaw (ibuclaw ubuntu.com)'s article
 There's a patch in Debian which addresses this. Last time I tried (a  
 nice fella
 allowed me to work via ssh'ing onto a sheevaplug) it mostly works, but  
 you'll need
 to use the gcstub sources, as the normal gc don't work (2.035~ish time  
 this was I
 think, so things may have improved since).
 Regards

First one fixes your linker errors. I'm not sure whether or not the second is needed for GCC-4.4 (it was for GCC-4.3). --- a/src/gcc/config/arm/arm-c.c 2007-11-05 17:13:46.000000000 +0000 +++ b/src/gcc/config/arm/arm-c.c 2010-08-29 11:42:36.503460693 +0100 -15,7 +15,7 { /* Tag_ABI_PCS_wchar_t. */ asm_fprintf (asm_out_file, "\t.eabi_attribute 18, %d\n", - (int)(TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT)); + (int)(WCHAR_TYPE_SIZE / BITS_PER_UNIT)); } --- a/src/gcc/d/d-gcc-includes.h 2010-08-19 12:30:20.000000000 +0100 +++ b/src/gcc/d/d-gcc-includes.h 2010-08-23 10:44:15.709788361 +0100 -32,7 +32,11 // hack needed to prevent inclusion of the generated insn-flags.h // which defines some inline functions that use C prototypes.... +// because some archs depend on this header for EH routines, +// only do this if EH_RETURN_HANDLER_RTX is already defined. +#ifdef EH_RETURN_HANDLER_RTX #define GCC_INSN_FLAGS_H +#endif // Conflicting definitions between stdio.h and libiberty.h over the throw() #define HAVE_DECL_ASPRINTF 1

Forget my last message, I tried to build an arm-elf cross compiler (because the archlinux gcc pakages did that). As arm-elf is bare metal ARM without the linux kernel, glibc and everything else the usual .configure make make install thing didn't work and therefore the original build script did some tricks to compile for arm-elf. I guess those tricks made the gdc setup fail. I've now built my own bintutils and gcc for arm-none-linux-gnueabi and here things worked out better. I still had to apply the first patch, the compiler was built and it tried to compile phobos. That failed in math.d because of missing ARM support: ------------------------------------------------------------------------------------------------------------------------- /var/abs/local/cross-arm-linux-gnueabi/cross-arm-none-linux-gnueabi-gdc2-hg/src gcc-build/./gcc/gdc -B/var/abs/local/cross-arm-linux-gnueabi/cross-arm-none-linux-gnueabi-gdc2-hg/ rc/gcc-build/./gcc/ -B/usr/arm-none-linux-gnueabi/bin/ -B/usr/arm-none-linux-gnueabi/lib/ -isystem /usr/arm-none-linux-gnueabi/include -isystem /usr/arm-none-linux-gnueabi/sys-include -o std/math.o -Wall -g -frelease -O2 -fversion=GC_Use_Alloc_MMap -fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -pipe -I ../../../gcc-4.4.5-build/libphobos -I ./arm-none-linux-gnueabi -fdeprecated -c ../../../gcc-4.4.5t-build/libphobos/std/math.d ../../../gcc-4.4.5-build/libphobos/std/math.d:2080: Error: undefined identifier INEXACT_MASK ../../../gcc-4.4.5-build/libphobos/std/math.d:2082: Error: undefined identifier UNDERFLOW_MASK ../../../gcc-4.4.5-build/libphobos/std/math.d:2084: Error: undefined identifier OVERFLOW_MASK ../../../gcc-4.4.5-build/libphobos/std/math.d:2086: Error: undefined identifier DIVBYZERO_MASK ../../../gcc-4.4.5-build/libphobos/std/math.d:2088: Error: undefined identifier INVALID_MASK make[3]: *** [std/math.o] Fehler 1 make[3]: Leaving directory `/var/abs/local/cross-arm-linux-gnueabi/cross-arm-none-linux-gnueabi-gdc2-hg/src/gcc-build/arm-none-linux-gnueabi/libphobos' make[2]: *** [all] Fehler 2 make[2]: Leaving directory `/var/abs/local/cross-arm-linux-gnueabi/cross-arm-none-linux-gnueabi-gdc2-hg/src/gcc-build/arm-none-linux-gnueabi/libphobos' make[1]: *** [all-target-libphobos] Fehler 2 make[1]: Leaving directory `/var/abs/local/cross-arm-linux-gnueabi/cross-arm-none-linux-gnueabi-gdc2-hg/src/gcc-build' ------------------------------------------------------------------------------------------------------------------------- I guess I have to find those values for ARM, but I fear there could be more ARM specific problems with phobos. -- Johannes Pfau
Nov 18 2010
prev sibling next sibling parent "Johannes Pfau" <spam example.com> writes:
Thanks again Iain,
I've got a working cross compiler now. The changes for phobos were rather  
small, I'll do some testing whether my changes actually work and if  
everything is fine I'll send those patches to the phobos mailing list.
The second gcc patch wasn't needed, and the default gc compiled fine. But  
somethings still wrong with the gc, it gets stuck in a loop somewhere.  
With the stub gc things work as they should.

One last question: If I build with --sysroot=/some/path the d include  
files still go to /usr/include/d2/4.4.5/ This could cause conflicts with  
multiple cross-compilers or the local compiler, is this the way it's  
supposed to be?
-- 
Johannes Pfau
Nov 22 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
 I've got a working cross compiler now. The changes for phobos were  
 rather small, I'll do some testing whether my changes actually work and  
 if everything is fine I'll send those patches to the phobos mailing list.
 The second gcc patch wasn't needed, and the default gc compiled fine.

So the runtime works out of the box? Doesn't it contain x86 specific inline assembler code?
Jan 29 2011
prev sibling next sibling parent Johannes Pfau <spam example.com> writes:
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Trass3r wrote:
 I've got a working cross compiler now. The changes for phobos were =20
 rather small, I'll do some testing whether my changes actually work
 and if everything is fine I'll send those patches to the phobos
 mailing list. The second gcc patch wasn't needed, and the default gc
 compiled fine.

So the runtime works out of the box? Doesn't it contain x86 specific inline assembler code?

I think most of the inline assembler code is in version statements and has d versions for other architectures. However, the _GDC_ druntime worked out of the box, it's possible that Iain already patched some things in there. I also didn't test it a lot because of the GC issue. The phobos changes are actually integrated in the latest GDC, but I can't test it right now. --=20 Johannes Pfau
Jan 30 2011
prev sibling parent Martin Kinkelin <noone spam.com> writes:
Hi, I also encountered these complaints about undefined c_global_trees while
trying to compile the latest GDC with GCC v4.5.2 using MinGW64 and MSYS (native
--build=x86_64-w64-mingw32). I've been trying to build an up-to-date x64 D2
compiler for Windows to finally start playing around with D.

---------------
g++  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include -I/c/gcc-4.5.2/build/./gmp
-I/c/gcc-4.5.2/gmp -I/c/gcc-4.5.2/build/./mpfr -I/c/gcc-4.5.2/mpfr
-I/c/gcc-4.5.2/mpc/src  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber     -I. -I. -I../../gcc
-I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include
-I/c/gcc-4.5.2/build/./gmp -I/c/gcc-4.5.2/gmp -I/c/gcc-4.5.2/build/./mpfr
-I/c/gcc-4.5.2/mpfr -I/c/gcc-4.5.2/mpc/src  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber    -I../../gcc/d
-I../../gcc/d/dmd2 -Id -D_GNU_SOURCE=1 -D_DH=1 -DD_NO_TRAMPOLINES=1 -DELFOBJ=1
-DLIBPHOBOS=\"-lgphobos2\" -DLIBPHOBOS_PROFILE=\"-lgphobos2\"
-DLIBDRUNTIME=\"-lgdruntime\" -DLIBDRUNTIME_PROFILE=\"-lgdruntime\"
-DD_GCC_VER=45
-Wno-missing-braces -Wno-format -Wno-missing-field-initializers
-fno-strict-aliasing -fmessage-length=0 -Wl,--stack,8388608 -o cc1d.exe \
		d/id.gen.o d/impcnvtab.gen.o attribs.o cppdefault.o stub-objc.o prefix.o
i386-c.o msformat-c.o  d/aav.dmd.o d/access.dmd.o d/aliasthis.dmd.o
d/array.dmd.o
d/arrayop.dmd.o d/async.dmd.o d/attrib.dmd.o d/cast.dmd.o d/class.dmd.o
d/clone.dmd.o d/cond.dmd.o d/constfold.dmd.o d/dchar.dmd.o d/declaration.dmd.o
d/delegatize.dmd.o d/doc.dmd.o d/dsymbol.dmd.o d/dump.dmd.o d/entity.dmd.o
d/enum.dmd.o d/expression.dmd.o d/func.dmd.o d/gnuc.dmd.o d/hdrgen.dmd.o
d/html.dmd.o d/identifier.dmd.o d/imphint.dmd.o d/import.dmd.o d/init.dmd.o
d/inline.dmd.o d/interpret.dmd.o d/json.dmd.o d/lexer.dmd.o d/lstring.dmd.o
d/macro.dmd.o d/mangle.dmd.o d/mars.dmd.o d/mtype.dmd.o d/module.dmd.o
d/opover.dmd.o d/optimize.dmd.o d/parse.dmd.o d/rmem.dmd.o d/root.dmd.o
d/scope.dmd.o d/speller.dmd.o d/statement.dmd.o d/staticassert.dmd.o
d/stringtable.dmd.o d/struct.dmd.o d/template.dmd.o d/todt.dmd.o d/toobj.dmd.o
d/typinf.dmd.o d/unialpha.dmd.o d/utf.dmd.o d/unittests.dmd.o d/version.dmd.o
d/argtypes.dmd.o d/builtin.dmd.o d/traits.dmd.o d/d-lang.glue.o d/d-decls.glue.o
d/d-codegen.glue.o d/d-objfile.glue.o d/d-irstate.glue.o d/d-glue.glue.o
d/d-convert.glue.o d/d-todt.glue.o d/d-gcc-real.glue.o d/d-gt.cglue.o
d/d-builtins.cglue.o d/d-misc.cglue.o d/d-builtins2.glue.o d/symbol.glue.o
d/asmstmt.glue.o d/dt.glue.o d/d-cppmngl.glue.o d/d-c-stubs.cglue.o main.o
libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a
-L/c/gcc-4.5.2/build/./gmp/.libs -L/c/gcc-4.5.2/build/./mpfr/.libs
-L/c/gcc-4.5.2/build/./mpc/src/.libs -lmpc -lmpfr -lgmp   -L../zlib -lz
../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
msformat-c.o:msformat-c.c:(.data+0x318): undefined reference to `c_global_trees'
...
---------------

Hacking the Makefile to link in c-common.o isn't enough here either.
So I guess there is a reason why Iain states that the latest working version for
Windows is D2.020 (from 2008 sadly) coupled with GCC v4.3.5. Could someone shed
some light on this?

Best regards and thanks for the hard work everybody,

Martin Kinkelin
Feb 09 2011