diff --git a/build.sh b/build.sh index 360b387..25f8347 100644 --- a/build.sh +++ b/build.sh @@ -133,22 +133,22 @@ make all --jobs make install declare -ra targets=( - 'ia64-unknown-linux-gnu' - 'alpha-unknown-linux-gnu' + # 'ia64-unknown-linux-gnu' + # 'alpha-unknown-linux-gnu' 'x86_64-unknown-linux-gnu' - 'i386-unknown-linux-gnu' - 'arm-unknown-linux-gnueabi' - 'arm-unknown-linux-gnueabihf' - 'hppa-unknown-linux-gnu' - 'aarch64-unknown-linux-gnu' - 'mips-unknown-linux-gnu' - 'mipsel-unknown-linux-gnu' - 'powerpc-unknown-linux-gnu' - 's390-unknown-linux-gnu' - 's390x-unknown-linux-gnu' - 'sparc-unknown-linux-gnu' - 'powerpc64le-unknown-linux-gnu' - 'mips64el-unknown-linux-gnuabi64' + # 'i386-unknown-linux-gnu' + # 'arm-unknown-linux-gnueabi' + # 'arm-unknown-linux-gnueabihf' + # 'hppa-unknown-linux-gnu' + # 'aarch64-unknown-linux-gnu' + # 'mips-unknown-linux-gnu' + # 'mipsel-unknown-linux-gnu' + # 'powerpc-unknown-linux-gnu' + # 's390-unknown-linux-gnu' + # 's390x-unknown-linux-gnu' + # 'sparc-unknown-linux-gnu' + # 'powerpc64le-unknown-linux-gnu' + # 'mips64el-unknown-linux-gnuabi64' ) for target in "${targets[@]}"; do diff --git a/tools/gcc-wrapper/main.c b/tools/gcc-wrapper/main.c index 7651a55..f218474 100644 --- a/tools/gcc-wrapper/main.c +++ b/tools/gcc-wrapper/main.c @@ -216,7 +216,7 @@ int main(int argc, char* argv[], char* envp[]) { strcat(gcc_include_directory, PATHSEP); strcat(gcc_include_directory, GCC_MAJOR_VERSION); strcat(gcc_include_directory, INCLUDE_DIR); - + /* gpp_include_directory = malloc(strlen(parent_directory) + strlen(INCLUDE_DIR) + strlen(PATHSEP) + strlen(CPP) + strlen(PATHSEP) + strlen(GCC_MAJOR_VERSION) + 1); if (gpp_include_directory == NULL) { @@ -232,6 +232,24 @@ int main(int argc, char* argv[], char* envp[]) { strcat(gpp_include_directory, CPP); strcat(gpp_include_directory, PATHSEP); strcat(gpp_include_directory, GCC_MAJOR_VERSION); + */ + gpp_include_directory = malloc(strlen(parent_directory) + strlen(PATHSEP) + strlen(triplet) + strlen(INCLUDE_DIR) + strlen(PATHSEP) + strlen(CPP) + strlen(PATHSEP) + strlen(GCC_MAJOR_VERSION) + 1); + + if (gpp_include_directory == NULL) { + fprintf(stderr, "fatal error: could not allocate memory\n"); + + status = EXIT_FAILURE; + goto end; + } + + strcpy(gpp_include_directory, parent_directory); + strcat(gpp_include_directory, PATHSEP); + strcat(gpp_include_directory, triplet); + strcat(gpp_include_directory, INCLUDE_DIR); + strcat(gpp_include_directory, PATHSEP); + strcat(gpp_include_directory, CPP); + strcat(gpp_include_directory, PATHSEP); + strcat(gpp_include_directory, GCC_MAJOR_VERSION); gpp_builtins_include_directory = malloc(strlen(gpp_include_directory) + strlen(PATHSEP) + strlen(triplet) + 1);