dragonegg arm patch

Hi Duncan,

I made a patch for dragonegg. This patch is for dragonegg to generate arm assembly code.

Dragonegg is compiled with this patch after building gcc-4.6 as cross compiler for arm and

then dragonegg can generate arm assembly code.

It currently makes errors to build dragonegg and llvm from svn. so I made a patch using

dragonegg-3.0 source code. (This patch doesn’t support TargetInstrinsic lowering as

compared with llvm-gcc.4.2)

If you allow this patch, I will commit this patch.

(May be, I will commit two directory “include/arm” and “src/arm”. because I don’t know

why “CC” is commented.)

Please review this patch.

Thanks,

Jin-Gu Kang

dragoneggARM.patch (37.7 KB)

Hi Jin-Gu,

I made a patch for dragonegg. This patch is for dragonegg to generate arm
assembly code.

thanks for working on this.

Dragonegg is compiled with this patch after building gcc-4.6 as cross compiler
for arm and

then dragonegg can generate arm assembly code.

It currently makes errors to build dragonegg and llvm from svn. so I made a
patch using

dragonegg-3.0 source code. (This patch doesn't support TargetInstrinsic lowering as

compared with llvm-gcc.4.2 )

If you allow this patch, I will commit this patch.

I applied a fix for decode_reg_name. CallingConv::ID is just an integer, as
such returning it by reference makes no sense. It was a silliness in the
llvm-gcc code and I don't want to reintroduce it, so those bits are no good.
I will try to build an ARM cross-compiler here to understand the rest better.
This might take a few days.

Ciao, Duncan.

Hi Duncan,

I appreciate your kind review.

I'd like to help you to build an ARM cross compiler.

I built GCC as following.

1. Download "arm-2010.09-50-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2"
You can find this file on https://sourcery.mentor.com/sgpp/lite/arm/portal/release1600.
(Please click "IA32 GNU/Linux TAR" on Packages.)

2. Extract this file on your linux machine.

3. Add "bin" directory of extracted file to PATH.
(ex: PATH=$PATH:"/home/jaykang10/Projects/ARM/arm-2010.09/bin)

4. configure gcc-4.6 as following. (I used gcc-4.6.2)
"source directory"/configure --prefix="install directory"
--target="ARM target"
--with-gnu-as="ARM assembler"
--with-gnu-ld="ARM linker"
--with-sysroot="directory to condiser as root filesystem"
--with-arch="ARM arch"
--enable-languages="languages"

Extracted arm-2010.09 toolchain is used for --with-gnu-as, --with-gnu-ld and
--with-sysroot options.
For example,
../../src/gcc-4.6.2/configure --prefix=/home/jaykang10/Projects/dragonegg/bin/gcc-4.6/
--target=arm-none-linux-gnueabi
--with-gnu-as=/home/jaykang10/Projects/ARM/arm-2010.09/bin/arm-none-linux-gnueabi-as
--with-gnu-ld=/home/jaykang10/Projects/ARM/arm-2010.09/bin/arm-none-linux-gnueabi-ld
--with-sysroot=/home/jaykang10/Projects/ARM/arm-2010.09/arm-none-linux-gnueabi/libc
--with-arch=armv6
--enable-languages=c,c++

5. make and make intall

I will modify code to use CallingConv::ID as integer.

Thanks for your kind review,
Jin-Gu Kang

Hi Duncan,

I send a modified patch which doesn't use reference type of CallingConv::ID.

Thanks,
Jin-Gu Kang

dragoneggARM.patch (35.8 KB)

Hi Jin Gu Kang,

I send a modified patch which doesn't use reference type of CallingConv::ID.

thanks for the patch. I applied it with some cosmetic changes, and now I can
compile bzip2 for ARM! I didn't check if the compiled program works though :slight_smile:

Ciao, Duncan.

Hi Jin Gu Kang, thanks for these helpful instructions.

For example,
../../src/gcc-4.6.2/configure --prefix=/home/jaykang10/Projects/dragonegg/bin/gcc-4.6/
  --target=arm-none-linux-gnueabi
  --with-gnu-as=/home/jaykang10/Projects/ARM/arm-2010.09/bin/arm-none-linux-gnueabi-as
  --with-gnu-ld=/home/jaykang10/Projects/ARM/arm-2010.09/bin/arm-none-linux-gnueabi-ld
  --with-sysroot=/home/jaykang10/Projects/ARM/arm-2010.09/arm-none-linux-gnueabi/libc
  --with-arch=armv6

^ I had to leave off --with-arch=armv6 otherwise the GCC 4.6 build failed
(unknown arch).

  --enable-languages=c,c++

Ciao, Duncan.

Thanks for applying this patch. I really appreciate that.

Sincerely,
Jin-Gu Kang

For the benefit of the rest of the mailing list:

  • The “–with-gnu-as/ld” should be just “–with-as/ld”.
  • Like Duncan, I had to drop the --with-arch.
  • After the ‘make install’ of gcc, I had to manually copy some files in the gcc/config directory over to the gcc install path to get dragon-egg to compile (I used gcc 4.6.1).

Now it all appears to be working fine. Thank you, Jin-Gu, for the patch.