diff options
Diffstat (limited to 'examples/recipes/gcc')
-rw-r--r-- | examples/recipes/gcc/build.libgcc-initial.yml | 49 | ||||
-rw-r--r-- | examples/recipes/gcc/build.libgcc.yml | 30 | ||||
-rw-r--r-- | examples/recipes/gcc/build.libs.yml | 29 | ||||
-rw-r--r-- | examples/recipes/gcc/build.yml | 126 |
4 files changed, 234 insertions, 0 deletions
diff --git a/examples/recipes/gcc/build.libgcc-initial.yml b/examples/recipes/gcc/build.libgcc-initial.yml new file mode 100644 index 0000000..ed230ba --- /dev/null +++ b/examples/recipes/gcc/build.libgcc-initial.yml @@ -0,0 +1,49 @@ +tasks: + configure: + args: + host: 'platform' + target: 'platform' + parent: + recipe: 'gcc' + task: 'compile' + depends: + - recipe: 'gcc' + task: 'header-stubs' + run: | + cd {{name}}-build + make configure-target-libgcc + + # A hack borrowed from OpenEmbedded: + # We can build an initial libgcc without having to rebuild the whole gcc + # afterwards by manipulating the Makefile + sed -i -r \ + -e 's@^(INHIBIT_LIBC_CFLAGS =).*@\1 -Dinhibit_libc@' \ + gcc/libgcc.mvars + sed -i -r \ + -e 's@^(thread_header =).*@\1 gthr-single.h@' \ + -e 's@^(enable_shared =).*@\1 no@' \ + {{target.gnu_triplet}}/libgcc/Makefile + + compile: + args: + host: 'platform' + target: 'platform' + parent: + task: 'configure' + run: | + cd {{name}}-build + make all-target-libgcc + + install: + args: + host: 'platform' + target: 'platform' + parent: + task: 'compile' + output: + default: {} + run: | + cd {{name}}-build + make DESTDIR={{destdir}} install-target-libgcc + + ln -s libgcc.a {{destdir}}{{host.prefix}}/lib/gcc/{{target.gnu_triplet}}/"$(cat ../{{name}}-{{version}}/gcc/BASE-VER)"/libgcc_eh.a diff --git a/examples/recipes/gcc/build.libgcc.yml b/examples/recipes/gcc/build.libgcc.yml new file mode 100644 index 0000000..67e21f7 --- /dev/null +++ b/examples/recipes/gcc/build.libgcc.yml @@ -0,0 +1,30 @@ +tasks: + compile: + args: + host: 'platform' + target: 'platform' + parent: + recipe: 'gcc' + task: 'compile' + depends: + - recipe: 'glibc' + task: 'install' + args: + host: 'target' + run: | + cd {{name}}-build + make all-target-libgcc + + install: + args: + host: 'platform' + target: 'platform' + parent: + task: 'compile' + output: + default: {} + run: | + cd {{name}}-build + make DESTDIR={{destdir}} install-target-libgcc + rm {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib/libgcc_s.so* + rmdir -p --ignore-fail-on-non-empty {{destdir}}{{host_to_target.sysroot}}{{target.prefix}}/lib diff --git a/examples/recipes/gcc/build.libs.yml b/examples/recipes/gcc/build.libs.yml new file mode 100644 index 0000000..856fd1c --- /dev/null +++ b/examples/recipes/gcc/build.libs.yml @@ -0,0 +1,29 @@ +tasks: + compile: + args: + host: 'platform' + parent: + recipe: 'gcc/libgcc' + task: 'compile' + args: + host: 'build' + target: 'host' + run: | + cd {{name}}-build + make all-target-libatomic all-target-libgomp all-target-libquadmath all-target-libstdc++-v3 + + install: + args: + host: 'platform' + parent: + task: 'compile' + output: + default: + path: 'sysroot' + run: | + cd {{name}}-build + make DESTDIR={{destdir}}/install install-target-libgcc install-target-libatomic install-target-libgomp install-target-libquadmath install-target-libstdc++-v3 + rm -r {{destdir}}/install{{build.prefix}}/lib/gcc + mv -T {{destdir}}/install/{{build_to_host.sysroot}} {{destdir}}/sysroot + cp -al {{destdir}}/install{{build.prefix}}/* {{destdir}}/sysroot{{host.prefix}} + rm {{destdir}}/sysroot{{host.prefix}}/lib/*.la diff --git a/examples/recipes/gcc/build.yml b/examples/recipes/gcc/build.yml new file mode 100644 index 0000000..3352b2d --- /dev/null +++ b/examples/recipes/gcc/build.yml @@ -0,0 +1,126 @@ +meta: + version: '13.2.0' +tasks: + unpack: + fetch: + - name: '{{name}}-{{version}}.tar.xz' + sha256: 'e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da' + run: | + tar xf {{dldir}}/{{name}}-{{version}}.tar.xz + + sed -i -e 's@^MULTILIB_OSDIRNAMES@# &@' {{name}}-{{version}}/gcc/config/*/t-* + + header-stubs: + args: + host: 'platform' + target: 'platform' + output: + default: {} + run: | + if {{not host_to_target.is_same}}; then + mkdir -p {{destdir}}{{target.prefix}}/include + touch {{destdir}}{{target.prefix}}/include/limits.h + fi + + configure: + args: + host: 'platform' + target: 'platform' + parent: + task: 'unpack' + build_depends: + - recipe: 'toolchain' + task: 'build_depends' + - recipe: 'binutils' + task: 'install' + args: + target: 'target' + depends: + - recipe: 'toolchain' + task: 'depends' + - recipe: 'mpc' + task: 'install' + - recipe: 'zlib' + task: 'install' + - task: 'header-stubs' + noinherit: true + run: | + export CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++" + + mkdir {{name}}-build + cd {{name}}-build + ../{{name}}-{{version}}/configure \ + --build={{build.gnu_triplet}} \ + --host={{host.gnu_triplet}} \ + --target={{target.gnu_triplet}} \ + --prefix={{host.prefix}} \ + --libdir={{host.prefix}}/lib \ + --libexecdir={{host.prefix}}/lib \ + --with-sysroot={{host_to_target.sysroot}} \ + --with-build-sysroot={{sysroot}} \ + --with-native-system-header-dir={{target.prefix}}/include \ + --with-toolexeclibdir={{host_to_target.sysroot}}{{target.prefix}}/lib \ + --with-gxx-include-dir={{host_to_target.sysroot}}{{target.prefix}}/include/c++/"$(cat ../{{name}}-{{version}}/gcc/BASE-VER)" \ + --with-gnu-ld \ + --enable-shared \ + --enable-languages=c,c++ \ + --enable-threads=posix \ + --disable-multilib \ + --enable-c99 \ + --enable-long-long \ + --enable-symvers=gnu \ + --enable-libstdcxx-pch \ + --without-local-prefix \ + --disable-install-libiberty \ + --disable-libssp \ + --enable-libitm \ + --enable-lto \ + --disable-bootstrap \ + --with-system-zlib \ + --with-linker-hash-style=gnu \ + --enable-linker-build-id \ + --with-ppl=no \ + --with-cloog=no \ + --enable-checking=release \ + --enable-cheaders=c_global \ + --without-isl \ + --with-system-zlib \ + --enable-standard-branch-protection \ + --with-glibc-version=2.28 \ + --enable-initfini-array \ + --enable-__cxa_atexit + find -name config.log -delete + + compile: + args: + host: 'platform' + target: 'platform' + parent: + task: 'configure' + depends: + - task: 'header-stubs' + noinherit: true + run: | + cd {{name}}-build + make all-host + find -name config.log -delete + + install: + args: + host: 'platform' + target: 'platform' + parent: + task: 'compile' + output: + default: + runtime_depends: + - recipe: 'binutils' + task: 'install' + - recipe: 'mpc' + task: 'install' + - recipe: 'zlib' + task: 'install' + run: | + cd {{name}}-build + make DESTDIR={{destdir}} install-host + |