Commits

Iain Buclaw committed 8fe76a5

Remove tls_index (Mingw runtime 3.18 provides it).
Edit configure scripts so cross compilers install imports in gcc version specific runtime directory - temporary stopgap until --enable-version-specific-runtime-libs and --with-gdc-include-dir are added and functional.

  • Participants
  • Parent commits bf18617

Comments (0)

Files changed (9)

 $(error D_LANGUAGE_VERSION not defined)
 endif
 
-D_dmd_srcdir=d/dmd$(D_ver_suffix)
-D_incl_subdir=d$(D_ver_suffix)
+D_dmd_srcdir = d/dmd$(D_ver_suffix)
 D_EXTRA_DEFINES += -DLIBPHOBOS=\"-lgphobos$(D_ver_suffix)\" 
 
 # This should be configured
-gcc_d_include_dir = $(libsubdir)/$(unlibsubdir)/..`echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/$(D_incl_subdir)/$(version)
+ifeq ($(host), $(target))
+  D_include_dir = `echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/d$(D_ver_suffix)/$(version)
+  gcc_d_include_dir = $(libsubdir)/$(unlibsubdir)/..$(D_include_dir)
+else
+  gcc_d_include_dir = $(libsubdir)/include/d$(D_ver_suffix)
+endif
+
 
 
 # Common headers between D1 and D2
             if (TREE_CODE(var_decl) == VAR_DECL)
             {   // %% If not marked, variable will be accessible
                 // from multiple threads, which is not what we want.
-                DECL_TLS_MODEL(var_decl) = decl_default_tls_model(var_decl);
+                if (targetm.have_tls)
+                    DECL_TLS_MODEL(var_decl) = decl_default_tls_model(var_decl);
+                else
+                    DECL_TLS_MODEL(var_decl) = TLS_MODEL_EMULATED;
             }
             if (global.params.vtls)
             {

d/druntime/core/thread.d

             {
                 extern int _tlsstart;
                 extern int _tlsend;
-                __gshared int _tls_index;   // %% Find somewhere to put this.
             }
         }
         else

d/phobos/configure

 
 # include dir .. need to support --enable-version-specific.. but
 # will have to modify gcc/configure.ac ..
-gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
+# For now, basic workaround for cross compilers ..
+if test "${host}" != "${target}"; then
+    gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d
+else
+    gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
+fi
 
 
 # Check whether --with-cross-host was given.

d/phobos/configure.in

 
 # include dir .. need to support --enable-version-specific.. but
 # will have to modify gcc/configure.ac ..
-gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
+# For now, basic workaround for cross compilers ..
+if test "${host}" != "${target}"; then
+    gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d
+else
+    gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
+fi
 AC_SUBST(gdc_include_dir)
 AC_ARG_WITH([cross-host],
   AC_HELP_STRING([--with-cross-host=HOST],

d/phobos2/Makefile.am

 	for i in core core/stdc core/sync core/sys/osx/mach core/sys/posix \
 		core/sys/posix/arpa core/sys/posix/net core/sys/posix/netinet \
 		core/sys/posix/sys core/sys/windows; do \
-		$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$$i; \
-		for f in $(IMPORT)/$$i/*.di; do $(INSTALL_HEADER) $$f $(DESTDIR)$(gdc_include_dir)/$$i; done; \
+		$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/$$i; \
+		for f in $(IMPORT)/$$i/*.di; do \
+			$(INSTALL_HEADER) $$f $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/$$i; \
+		done; \
 	done
 	for i in crc32.d object.di; do \
 		$(INSTALL_HEADER) $(srcdir)/$$i $(DESTDIR)$(gdc_include_dir); done

d/phobos2/Makefile.in

 	for i in core core/stdc core/sync core/sys/osx/mach core/sys/posix \
 		core/sys/posix/arpa core/sys/posix/net core/sys/posix/netinet \
 		core/sys/posix/sys core/sys/windows; do \
-		$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$$i; \
-		for f in $(IMPORT)/$$i/*.di; do $(INSTALL_HEADER) $$f $(DESTDIR)$(gdc_include_dir)/$$i; done; \
+		$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/$$i; \
+		for f in $(IMPORT)/$$i/*.di; do \
+			$(INSTALL_HEADER) $$f $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/$$i; \
+		done; \
 	done
 	for i in crc32.d object.di; do \
 		$(INSTALL_HEADER) $(srcdir)/$$i $(DESTDIR)$(gdc_include_dir); done

d/phobos2/configure

 
 # include dir .. need to support --enable-version-specific.. but
 # will have to modify gcc/configure.ac ..
-gdc_include_dir='${prefix}'/include/d2/${d_gcc_ver}
+# For now, basic workaround for cross compilers ..
+if test "${host}" != "${target}"; then
+    gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d2
+else
+    gdc_include_dir='${prefix}'/include/d2/${d_gcc_ver}
+fi
 
 
 # Check whether --with-cross-host was given.

d/phobos2/configure.in

 
 # include dir .. need to support --enable-version-specific.. but
 # will have to modify gcc/configure.ac ..
-gdc_include_dir='${prefix}'/include/d2/${d_gcc_ver}
+# For now, basic workaround for cross compilers ..
+if test "${host}" != "${build}"; then
+    gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d2
+else
+    gdc_include_dir='${prefix}'/include/d2/${d_gcc_ver}
+fi
 AC_SUBST(gdc_include_dir)
 AC_ARG_WITH([cross-host],
   AC_HELP_STRING([--with-cross-host=HOST],