I'm adding to my operating system the dynamic linker to support shared libraries but i noticed that the cross building of the GCC (v4.9.1) doesn't creates the libstdc++.so.
On the gcc's configure i added the parameters "--enable-shared" and "--enable-host-shared" and on the config file that patch the gcc i added the support for dynamic executables
Code: Select all
diff -Nur gcc-4.9.1/gcc/config/mx.h gcc-4.9.1-mx/gcc/config/mx.h
--- gcc-4.9.1/gcc/config/mx.h 1970-01-01 01:00:00.000000000 +0100
+++ gcc-4.9.1-mx/gcc/config/mx.h 2017-05-22 21:57:42.000000000 +0200
@@ -0,0 +1,32 @@
+// built-in defines
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+do { \
+ builtin_define_std ("MeetiX"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=mx"); \
+ builtin_assert ("system=unix"); \
+} while(0);
+
+// for MeetiX-specific changes on GCC
+#undef TARGET_MEETIX
+#define TARGET_MEETIX 1
+
+// don't automatically add extern "C" { } around header files
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C 1
+
+// define the default library specifications
+#undef LIB_SPEC
+#define LIB_SPEC "%{!shared:--start-group -lapi -lc --end-group}"
+
+// start and end files
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared: %{!pg:crt0.o%s}} crti.o%s %{!shared:crtbegin.o%s}"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "%{!shared:crtend.o%s} crtn.o%s"
+
+// specify the links types
+#undef LINK_SPEC
+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld.so}}}"
+
+// modify location of the start files
+#undef STANDARD_STARTFILE_PREFIX
+#define STANDARD_STARTFILE_PREFIX "/lib/"
From what I read in another thread the problem is in libtool, that doesn't recognize the cross target, but I didn't find anything that could help me to solve it.