Skip to content

Loading…

Fix C++ include paths #4

Open
Tatsh opened this Issue · 1 comment

2 participants

@Tatsh
Owner

Try this patch (thanks to @BlackhornFR on Twitter)

diff -urN gcc-5666.3/gcc/cppdefault.c gcc-5666.3.mod/gcc/cppdefault.c
--- gcc-5666.3/gcc/cppdefault.c 2010-10-14 22:27:54.000000000 +0200
+++ gcc-5666.3.mod/gcc/cppdefault.c 2012-11-05 15:03:46.252004432 +0100
@@ -53,34 +53,34 @@
 = {
 #ifdef GPLUSPLUS_INCLUDE_DIR
     /* Pick up GNU C++ generic include files.  */
-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
 #endif
 #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
     /* Pick up GNU C++ target-dependent include files.  */
-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1, 1 },
+    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 1 },
 #endif
 #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
     /* Pick up GNU C++ backward and deprecated include files.  */
-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1, 0 },
+    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 },
 #endif
 #ifdef LOCAL_INCLUDE_DIR
     /* /usr/local/include comes before the fixincluded header files.  */
-    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+    { LOCAL_INCLUDE_DIR, 0, 0, 1, 0, 0 },
 #endif
 #ifdef PREFIX_INCLUDE_DIR
-    { PREFIX_INCLUDE_DIR, 0, 0, 1, 1, 0 },
+    { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
 #endif
 #ifdef GCC_INCLUDE_DIR
     /* This is the dir for fixincludes and for gcc's private headers.  */
-    { GCC_INCLUDE_DIR, "GCC", 0, 0, 1, 0 },
+    { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
 #endif
 #ifdef CROSS_INCLUDE_DIR
     /* One place the target system's headers might be.  */
-    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 1, 0 },
+    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
 #endif
 #ifdef TOOL_INCLUDE_DIR
     /* Another place the target system's headers might be.  */
-    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 1, 0 },
+    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
 #endif
 #ifdef SYSTEM_INCLUDE_DIR
     /* Some systems have an extra dir of include files.  */
Les fichiers binaires gcc-5666.3/gcc/.Makefile.in.swp et gcc-5666.3.mod/gcc/.Makefile.in.swp sont différents
@Tatsh Tatsh was assigned
@raptor

A good way to see all the include directory problems is to run a command like so (with the backticks):

`/usr/x86_64-apple-darwin11/usr/bin/x86_64-apple-darwin11-gcc -print-prog-name=cc1plus` -v

(then press CTRL+C to quit)

You can see that the search paths are pointing to non-existent directories. Part of it (I believe) is due to the 'tooldir' patch. For reference, see the corresponding patch for the older gcc-apple from openttd which seems more complete: http://devs.openttd.org/~truebrain/compile-farm/gcc-tooldir.patch

It also doesn't matter if you specify the configure option "--with-gxx-include-dir" as it seems that configuring never sets up the correct paths in the final binary anyways...

The quick hack to fix this is usually creating the appropriate soft-link so the output of the above command doesn't spit out any "ignoring nonexistent directory" errors. Either this, or properly patch gcc-apple to configure directories appropriately (which is above my head)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.