Skip to content

Commit a9b6655

Browse files
committed
Add cross-compiling toolchain
And Makefile with targets to rebuild it.
1 parent 6e80677 commit a9b6655

File tree

242 files changed

+175396
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+175396
-0
lines changed

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
BASEDIR = $(PWD)
2+
CROSSDIR = $(BASEDIR)/cross
3+
BINUTILS_SRC = $(CROSSDIR)/binutils-2.22
4+
BINUTILS_BUILD = $(CROSSDIR)/binutils-build
5+
GCC_SRC = $(CROSSDIR)/gcc-4.6.4
6+
GCC_BUILD = $(CROSSDIR)/gcc-build
7+
CROSSBINDIR = $(CROSSDIR)/bin
8+
TARGET = i586-elf
9+
10+
$(BINUTILS_SRC):
11+
wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz && \
12+
tar xzvf binutils-2.22.tar.gz && rm binutils-2.22.tar.gz
13+
14+
build-cross-binutils: $(BINUTILS_SRC)
15+
mkdir -p $(BINUTILS_BUILD) && cd $(BINUTILS_BUILD) && \
16+
$(BINUTILS_SRC)/configure --target=$(TARGET) --prefix="$(CROSSDIR)" --disable-nls && \
17+
make && make install
18+
19+
$(GCC_SRC):
20+
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.4/gcc-core-4.6.4.tar.gz && \
21+
tar xzvf gcc-core-4.6.4.tar.gz && rm gcc-core-4.6.4.tar.gz && \
22+
cd $(GCC_SRC) && contrib/download_prerequisites
23+
24+
build-cross-gcc: $(GCC_SRC)
25+
mkdir -p $(GCC_BUILD) && cd $(GCC_BUILD) && \
26+
$(GCC_SRC)/configure --target=$(TARGET) --prefix="$(CROSSDIR)" --disable-nls --enable-languages=c --without-headers && \
27+
make all-gcc && make all-target-libgcc && make install-gcc && make install-target-libgcc

cross/bin/i586-elf-addr2line

2.71 MB
Binary file not shown.

cross/bin/i586-elf-ar

2.84 MB
Binary file not shown.

cross/bin/i586-elf-as

4.13 MB
Binary file not shown.

cross/bin/i586-elf-c++filt

2.68 MB
Binary file not shown.

cross/bin/i586-elf-cpp

708 KB
Binary file not shown.

cross/bin/i586-elf-elfedit

68.9 KB
Binary file not shown.

cross/bin/i586-elf-gcc

701 KB
Binary file not shown.

cross/bin/i586-elf-gcc-4.6.4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
i586-elf-gcc

cross/bin/i586-elf-gcov

96.3 KB
Binary file not shown.

cross/bin/i586-elf-gprof

3.13 MB
Binary file not shown.

cross/bin/i586-elf-ld

3.68 MB
Binary file not shown.

cross/bin/i586-elf-ld.bfd

3.68 MB
Binary file not shown.

cross/bin/i586-elf-nm

2.74 MB
Binary file not shown.

cross/bin/i586-elf-objcopy

3.32 MB
Binary file not shown.

cross/bin/i586-elf-objdump

3.95 MB
Binary file not shown.

cross/bin/i586-elf-ranlib

2.84 MB
Binary file not shown.

cross/bin/i586-elf-readelf

790 KB
Binary file not shown.

cross/bin/i586-elf-size

2.73 MB
Binary file not shown.

cross/bin/i586-elf-strings

2.7 MB
Binary file not shown.

cross/bin/i586-elf-strip

3.32 MB
Binary file not shown.
1.98 KB
Binary file not shown.

cross/lib/gcc/i586-elf/4.6.4/crtend.o

1.3 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This README file is copied into the directory for GCC-only header files
2+
when fixincludes is run by the makefile for GCC.
3+
4+
Many of the files in this directory were automatically edited from the
5+
standard system header files by the fixincludes process. They are
6+
system-specific, and will not work on any other kind of system. They
7+
are also not part of GCC. The reason we have to do this is because
8+
GCC requires ANSI C headers and many vendors supply ANSI-incompatible
9+
headers.
10+
11+
Because this is an automated process, sometimes headers get "fixed"
12+
that do not, strictly speaking, need a fix. As long as nothing is broken
13+
by the process, it is just an unfortunate collateral inconvenience.
14+
We would like to rectify it, if it is not "too inconvenient".
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001,
2+
2002 Free Software Foundation, Inc.
3+
4+
This file is part of GCC.
5+
6+
GCC is free software; you can redistribute it and/or modify it under
7+
the terms of the GNU General Public License as published by the Free
8+
Software Foundation; either version 3, or (at your option) any later
9+
version.
10+
11+
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
for more details.
15+
16+
Under Section 7 of GPL version 3, you are granted additional
17+
permissions described in the GCC Runtime Library Exception, version
18+
3.1, as published by the Free Software Foundation.
19+
20+
You should have received a copy of the GNU General Public License and
21+
a copy of the GCC Runtime Library Exception along with this program;
22+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23+
<http://www.gnu.org/licenses/>. */
24+
25+
#ifndef _LIMITS_H___
26+
#define _LIMITS_H___
27+
28+
/* Number of bits in a `char'. */
29+
#undef CHAR_BIT
30+
#define CHAR_BIT __CHAR_BIT__
31+
32+
/* Maximum length of a multibyte character. */
33+
#ifndef MB_LEN_MAX
34+
#define MB_LEN_MAX 1
35+
#endif
36+
37+
/* Minimum and maximum values a `signed char' can hold. */
38+
#undef SCHAR_MIN
39+
#define SCHAR_MIN (-SCHAR_MAX - 1)
40+
#undef SCHAR_MAX
41+
#define SCHAR_MAX __SCHAR_MAX__
42+
43+
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
44+
#undef UCHAR_MAX
45+
#if __SCHAR_MAX__ == __INT_MAX__
46+
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
47+
#else
48+
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
49+
#endif
50+
51+
/* Minimum and maximum values a `char' can hold. */
52+
#ifdef __CHAR_UNSIGNED__
53+
# undef CHAR_MIN
54+
# if __SCHAR_MAX__ == __INT_MAX__
55+
# define CHAR_MIN 0U
56+
# else
57+
# define CHAR_MIN 0
58+
# endif
59+
# undef CHAR_MAX
60+
# define CHAR_MAX UCHAR_MAX
61+
#else
62+
# undef CHAR_MIN
63+
# define CHAR_MIN SCHAR_MIN
64+
# undef CHAR_MAX
65+
# define CHAR_MAX SCHAR_MAX
66+
#endif
67+
68+
/* Minimum and maximum values a `signed short int' can hold. */
69+
#undef SHRT_MIN
70+
#define SHRT_MIN (-SHRT_MAX - 1)
71+
#undef SHRT_MAX
72+
#define SHRT_MAX __SHRT_MAX__
73+
74+
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
75+
#undef USHRT_MAX
76+
#if __SHRT_MAX__ == __INT_MAX__
77+
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
78+
#else
79+
# define USHRT_MAX (SHRT_MAX * 2 + 1)
80+
#endif
81+
82+
/* Minimum and maximum values a `signed int' can hold. */
83+
#undef INT_MIN
84+
#define INT_MIN (-INT_MAX - 1)
85+
#undef INT_MAX
86+
#define INT_MAX __INT_MAX__
87+
88+
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
89+
#undef UINT_MAX
90+
#define UINT_MAX (INT_MAX * 2U + 1U)
91+
92+
/* Minimum and maximum values a `signed long int' can hold.
93+
(Same as `int'). */
94+
#undef LONG_MIN
95+
#define LONG_MIN (-LONG_MAX - 1L)
96+
#undef LONG_MAX
97+
#define LONG_MAX __LONG_MAX__
98+
99+
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
100+
#undef ULONG_MAX
101+
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
102+
103+
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
104+
/* Minimum and maximum values a `signed long long int' can hold. */
105+
# undef LLONG_MIN
106+
# define LLONG_MIN (-LLONG_MAX - 1LL)
107+
# undef LLONG_MAX
108+
# define LLONG_MAX __LONG_LONG_MAX__
109+
110+
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
111+
# undef ULLONG_MAX
112+
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
113+
#endif
114+
115+
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
116+
/* Minimum and maximum values a `signed long long int' can hold. */
117+
# undef LONG_LONG_MIN
118+
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
119+
# undef LONG_LONG_MAX
120+
# define LONG_LONG_MAX __LONG_LONG_MAX__
121+
122+
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
123+
# undef ULONG_LONG_MAX
124+
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
125+
#endif
126+
127+
#endif /* _LIMITS_H___ */
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* syslimits.h stands for the system's own limits.h file.
2+
If we can use it ok unmodified, then we install this text.
3+
If fixincludes fixes it, then the fixed version is installed
4+
instead of this text. */
5+
6+
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
7+
#include_next <limits.h>
8+
#undef _GCC_NEXT_LIMITS_H
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* Copyright (C) 2009 Free Software Foundation, Inc.
2+
3+
This file is part of GCC.
4+
5+
GCC is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3, or (at your option)
8+
any later version.
9+
10+
GCC is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
Under Section 7 of GPL version 3, you are granted additional
16+
permissions described in the GCC Runtime Library Exception, version
17+
3.1, as published by the Free Software Foundation.
18+
19+
You should have received a copy of the GNU General Public License and
20+
a copy of the GCC Runtime Library Exception along with this program;
21+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22+
<http://www.gnu.org/licenses/>. */
23+
24+
#ifndef _X86INTRIN_H_INCLUDED
25+
# error "Never use <abmintrin.h> directly; include <x86intrin.h> instead."
26+
#endif
27+
28+
#ifndef __ABM__
29+
# error "ABM instruction set not enabled"
30+
#endif /* __ABM__ */
31+
32+
#ifndef _ABMINTRIN_H_INCLUDED
33+
#define _ABMINTRIN_H_INCLUDED
34+
35+
extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__))
36+
__lzcnt16 (unsigned short __X)
37+
{
38+
return __builtin_clzs (__X);
39+
}
40+
41+
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
42+
__lzcnt (unsigned int __X)
43+
{
44+
return __builtin_clz (__X);
45+
}
46+
47+
#ifdef __x86_64__
48+
extern __inline unsigned long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
49+
__lzcnt64 (unsigned long __X)
50+
{
51+
return __builtin_clzl (__X);
52+
}
53+
#endif
54+
55+
#endif /* _ABMINTRIN_H_INCLUDED */
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
2+
3+
This file is part of GCC.
4+
5+
GCC is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3, or (at your option)
8+
any later version.
9+
10+
GCC is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
Under Section 7 of GPL version 3, you are granted additional
16+
permissions described in the GCC Runtime Library Exception, version
17+
3.1, as published by the Free Software Foundation.
18+
19+
You should have received a copy of the GNU General Public License and
20+
a copy of the GCC Runtime Library Exception along with this program;
21+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22+
<http://www.gnu.org/licenses/>. */
23+
24+
/* Implemented from the specification included in the AMD Programmers
25+
Manual Update, version 2.x */
26+
27+
#ifndef _AMMINTRIN_H_INCLUDED
28+
#define _AMMINTRIN_H_INCLUDED
29+
30+
#ifndef __SSE4A__
31+
# error "SSE4A instruction set not enabled"
32+
#else
33+
34+
/* We need definitions from the SSE3, SSE2 and SSE header files*/
35+
#include <pmmintrin.h>
36+
37+
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
38+
_mm_stream_sd (double * __P, __m128d __Y)
39+
{
40+
__builtin_ia32_movntsd (__P, (__v2df) __Y);
41+
}
42+
43+
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
44+
_mm_stream_ss (float * __P, __m128 __Y)
45+
{
46+
__builtin_ia32_movntss (__P, (__v4sf) __Y);
47+
}
48+
49+
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
50+
_mm_extract_si64 (__m128i __X, __m128i __Y)
51+
{
52+
return (__m128i) __builtin_ia32_extrq ((__v2di) __X, (__v16qi) __Y);
53+
}
54+
55+
#ifdef __OPTIMIZE__
56+
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
57+
_mm_extracti_si64 (__m128i __X, unsigned const int __I, unsigned const int __L)
58+
{
59+
return (__m128i) __builtin_ia32_extrqi ((__v2di) __X, __I, __L);
60+
}
61+
#else
62+
#define _mm_extracti_si64(X, I, L) \
63+
((__m128i) __builtin_ia32_extrqi ((__v2di)(__m128i)(X), \
64+
(unsigned int)(I), (unsigned int)(L)))
65+
#endif
66+
67+
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
68+
_mm_insert_si64 (__m128i __X,__m128i __Y)
69+
{
70+
return (__m128i) __builtin_ia32_insertq ((__v2di)__X, (__v2di)__Y);
71+
}
72+
73+
#ifdef __OPTIMIZE__
74+
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
75+
_mm_inserti_si64(__m128i __X, __m128i __Y, unsigned const int __I, unsigned const int __L)
76+
{
77+
return (__m128i) __builtin_ia32_insertqi ((__v2di)__X, (__v2di)__Y, __I, __L);
78+
}
79+
#else
80+
#define _mm_inserti_si64(X, Y, I, L) \
81+
((__m128i) __builtin_ia32_insertqi ((__v2di)(__m128i)(X), \
82+
(__v2di)(__m128i)(Y), \
83+
(unsigned int)(I), (unsigned int)(L)))
84+
#endif
85+
86+
#endif /* __SSE4A__ */
87+
88+
#endif /* _AMMINTRIN_H_INCLUDED */

0 commit comments

Comments
 (0)