Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / misc / gcc-3.3.6.patch
1 GCC 3.3.6 has a bug in the i386-elf target: it fails to emit
2 .intel_syntax in assembly files if -masm=intel is passed on the
3 command line.  This is because elfos.h overrides the ASM_FILE_START
4 provided by gcc/config/att.h, which emits that directive, with a
5 version that does not.  This patch covers up the problem.
6
7 Here are the commands we used to build and install the SPARC
8 cross-compiler:
9
10 PINTOSROOT=$HOME/private/pintos
11
12 PREFIX=/usr/class/cs140/`uname -m`
13 PATH=$PATH:$PREFIX/bin
14 TMP=`pwd`
15
16 wget ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.tar.bz2
17 wget ftp://sources.redhat.com/pub/newlib/newlib-1.13.0.tar.gz
18 wget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.3.6/gcc-core-3.3.6.tar.bz2
19 wget ftp://ftp.gnu.org/pub/gnu/gdb/gdb-6.3.tar.bz2
20
21 bzcat binutils-2.16.tar.bz2 | tar x
22 tar xzf newlib-1.13.0.tar.gz
23 bzcat gcc-core-3.3.6.tar.bz2 | tar x
24 bzcat gdb-6.3.tar.bz2 | tar x
25
26 cd $TMP/binutils-2.16
27 mkdir i386
28 cd i386
29 ../configure --target=i386-elf --prefix=$PREFIX
30 make LDFLAGS=-lintl
31 make install
32
33 cd $TMP/gcc-3.3.6
34 patch gcc/config/elfos.h < $PINTOSROOT/src/misc/gcc-3.3.6.patch
35 mkdir i386
36 cd i386
37 ../configure --target=i386-elf --prefix=$PREFIX --with-gnu-as --with-as=$PREFIX/bin/i386-elf-as --with-gnu-ld --with-ld=$PREFIX/bin/i386-elf-ld --with-headers=$TMP/newlib-1.13.0/newlib/libc/include --with-newlib
38 make
39 make install
40
41 cd $TMP/gdb-6.3
42 mkdir i386
43 cd i386
44 ../configure --target=i386-elf --prefix=$PREFIX --disable-tui
45 make LDFLAGS=-lintl
46 make install
47
48 --- gcc/config/elfos.h~ 2005-01-03 21:14:58.312309000 -0800
49 +++ gcc/config/elfos.h  2005-01-03 21:03:51.758598000 -0800
50 @@ -97,9 +97,11 @@
51     directive for any specific target, you should override this definition
52     in the target-specific file which includes this one.  */
53  
54 +#if 0
55  #undef ASM_FILE_START
56  #define ASM_FILE_START(FILE)                            \
57    output_file_directive ((FILE), main_input_filename)
58 +#endif
59  
60  /* This is how to allocate empty space in some section.  The .zero
61     pseudo-op is used for this on most svr4 assemblers.  */