Bugzilla – Attachment 73 Details for
Bug 149
using libgdruntime.so and libgphobos2.so
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug creation and email sending has been disabled, file new bugs at
gcc.gnu.org/bugzilla
[patch]
patch to build and use libgdruntime.so and libgphobos2.so
sos.patch (text/plain), 9.50 KB, created by
Ketmar Dark
on 2014-08-12 07:08:57 CEST
(
hide
)
Description:
patch to build and use libgdruntime.so and libgphobos2.so
Filename:
MIME Type:
Creator:
Ketmar Dark
Created:
2014-08-12 07:08:57 CEST
Size:
9.50 KB
patch
obsolete
>diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am >index ad3be20..17b6b8f 100644 >--- a/libphobos/libdruntime/Makefile.am >+++ b/libphobos/libdruntime/Makefile.am >@@ -27,7 +27,7 @@ IMPDIR = import > toolexecdir = $(phobos_toolexecdir) > toolexeclibdir = $(phobos_toolexeclibdir) > >-all-local: libgdruntime.a >+all-local: libgdruntime.a libgdruntime.so > > SUFFIXES = .d > >@@ -125,7 +125,7 @@ RT_POSIX_OBJS=core/sys/posix/dirent.o core/sys/posix/netdb.o \ > core/sys/posix/sys/select.o core/sys/posix/sys/socket.o \ > core/sys/posix/sys/stat.o core/sys/posix/sys/wait.o \ > core/sys/posix/sys/un.o core/sys/posix/sys/utsname.o \ >- core/sys/posix/sys/utsname.o core/sys/posix/netinet/in_.o >+ core/sys/posix/netinet/in_.o > > RT_WINDOWS_OBJS=core/sys/windows/dbghelp.o core/sys/windows/dll.o \ > core/sys/windows/stacktrace.o core/sys/windows/threadaux.o \ >@@ -210,6 +210,15 @@ else > endif > $(RANLIB) $@ > >+libgdruntime.so : $(ALL_DRUNTIME_OBJS) \ >+ $(subst core/,$(IMPDIR)/core/,$(CORE_IMPORTS)) \ >+ $(subst gcc/,$(IMPDIR)/gcc/,$(GCC_IMPORTS)) >+if BACKTRACE_SUPPORTED >+ $(GDC) -nophoboslib -shared -o $@ $(ALL_DRUNTIME_OBJS) $(LIBBACKTRACE_LIB) >+else >+ $(GDC) -nophoboslib -shared -o $@ $(ALL_DRUNTIME_OBJS) >+endif >+ > libgdruntime_t.a : $(ALL_DRUNTIME_OBJS:.o=.t.o) > if BACKTRACE_SUPPORTED > cp -f $(LIBBACKTRACE_LIB) $@ >@@ -225,10 +234,11 @@ unittest: libgdruntime.a libgdruntime_t.a unittest.o > #--------------------------------------# > # Install, doc, etc targets > >-install-exec-local: libgdruntime.a >+install-exec-local: libgdruntime.a libgdruntime.so > $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) > $(INSTALL) libgdruntime.a $(DESTDIR)$(toolexeclibdir) > $(RANLIB) $(DESTDIR)$(toolexeclibdir)/libgdruntime.a >+ $(INSTALL) libgdruntime.so $(DESTDIR)$(toolexeclibdir) > > install-data-local: libgdruntime.a > $(mkinstalldirs) $(DESTDIR)$(gdc_include_dir) >@@ -270,6 +280,7 @@ clean-local: > rm -f $(GCC_IMPORTS) > rm -rf $(IMPDIR) > rm -f libgdruntime.a >+ rm -f libgdruntime.so > > check-local: unittest > ./unittest >diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in >index 5c2888b..4ec582f 100644 >--- a/libphobos/libdruntime/Makefile.in >+++ b/libphobos/libdruntime/Makefile.in >@@ -272,7 +272,7 @@ RT_POSIX_OBJS = core/sys/posix/dirent.o core/sys/posix/netdb.o \ > core/sys/posix/sys/select.o core/sys/posix/sys/socket.o \ > core/sys/posix/sys/stat.o core/sys/posix/sys/wait.o \ > core/sys/posix/sys/un.o core/sys/posix/sys/utsname.o \ >- core/sys/posix/sys/utsname.o core/sys/posix/netinet/in_.o >+ core/sys/posix/netinet/in_.o > > RT_WINDOWS_OBJS = core/sys/windows/dbghelp.o core/sys/windows/dll.o \ > core/sys/windows/stacktrace.o core/sys/windows/threadaux.o \ >@@ -578,7 +578,7 @@ uninstall-am: > uninstall-am > > >-all-local: libgdruntime.a >+all-local: libgdruntime.a libgdruntime.so > > %.o : %.d > $(GDC) -o $@ $(ALL_DFLAGS) -c $< >@@ -629,6 +629,12 @@ libgdruntime.a : $(ALL_DRUNTIME_OBJS) \ > @BACKTRACE_SUPPORTED_FALSE@ $(AR) -r $@ $(ALL_DRUNTIME_OBJS) > $(RANLIB) $@ > >+libgdruntime.so : $(ALL_DRUNTIME_OBJS) \ >+ $(subst core/,$(IMPDIR)/core/,$(CORE_IMPORTS)) \ >+ $(subst gcc/,$(IMPDIR)/gcc/,$(GCC_IMPORTS)) >+@BACKTRACE_SUPPORTED_TRUE@ $(GDC) -nophoboslib -shared -o $@ $(ALL_DRUNTIME_OBJS) $(LIBBACKTRACE_LIB) >+@BACKTRACE_SUPPORTED_FALSE@ $(GDC) -nophoboslib -shared -o $@ $(ALL_DRUNTIME_OBJS) >+ > libgdruntime_t.a : $(ALL_DRUNTIME_OBJS:.o=.t.o) > @BACKTRACE_SUPPORTED_TRUE@ cp -f $(LIBBACKTRACE_LIB) $@ > @BACKTRACE_SUPPORTED_TRUE@ $(AR) -q $@ $(ALL_DRUNTIME_OBJS:.o=.t.o) >@@ -641,10 +647,11 @@ unittest: libgdruntime.a libgdruntime_t.a unittest.o > #--------------------------------------# > # Install, doc, etc targets > >-install-exec-local: libgdruntime.a >+install-exec-local: libgdruntime.a libgdruntime.so > $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) > $(INSTALL) libgdruntime.a $(DESTDIR)$(toolexeclibdir) > $(RANLIB) $(DESTDIR)$(toolexeclibdir)/libgdruntime.a >+ $(INSTALL) libgdruntime.so $(DESTDIR)$(toolexeclibdir) > > install-data-local: libgdruntime.a > $(mkinstalldirs) $(DESTDIR)$(gdc_include_dir) >diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am >index f7ab1d3..96ca0fb 100644 >--- a/libphobos/src/Makefile.am >+++ b/libphobos/src/Makefile.am >@@ -26,7 +26,7 @@ ALL_DFLAGS=$(DFLAGS) $(D_EXTRA_DFLAGS) $(MULTIFLAGS) > toolexecdir = $(phobos_toolexecdir) > toolexeclibdir = $(phobos_toolexeclibdir) > >-all-local: libgphobos2.a >+all-local: libgphobos2.a libgphobos2.so > > SUFFIXES = .d > >@@ -98,7 +98,9 @@ ZLIB_OBJS=@ZLIB_OBJS@ > OS_OBJS=std/file.o std/mmfile.o std/path.o std/process.o \ > std/socket.o std/socketstream.o > >-LINUX_OBJS=std/c/linux/linux.o std/c/linux/socket.o >+#LINUX_OBJS=std/c/linux/linux.o std/c/linux/socket.o >+# std/c/linux/linux.o is in D_EXTRA_OBJS >+LINUX_OBJS=std/c/linux/socket.o > > OSX_OBJS=std/c/osx/socket.o > >@@ -120,6 +122,9 @@ libgphobos2.a : $(ALL_PHOBOS_OBJS) ../libdruntime/libgdruntime.a > $(AR) -q $@ $(ALL_PHOBOS_OBJS) > $(RANLIB) $@ > >+libgphobos2.so : $(ALL_PHOBOS_OBJS) ../libdruntime/libgdruntime.so >+ $(GDC) -nophoboslib -shared -o $@ $(ALL_PHOBOS_OBJS) >+ > libgphobos2_t.a : $(ALL_PHOBOS_OBJS:.o=.t.o) > $(AR) -r $@ $(ALL_PHOBOS_OBJS:.o=.t.o) > $(RANLIB) $@ >@@ -130,10 +135,11 @@ unittest: libgphobos2.a libgphobos2_t.a unittest.o > #--------------------------------------# > # Install, doc, etc targets > >-install-exec-local: libgphobos2.a >+install-exec-local: libgphobos2.a libgphobos2.so > $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) > $(INSTALL) libgphobos2.a $(DESTDIR)$(toolexeclibdir) > $(RANLIB) $(DESTDIR)$(toolexeclibdir)/libgphobos2.a >+ $(INSTALL) libgphobos2.so $(DESTDIR)$(toolexeclibdir) > > install-data-local: libgphobos2.a > for i in etc/c \ >@@ -155,6 +161,7 @@ clean-local: > rm -f unittest$(EXEEXT) > rm -f libgphobos2.a > rm -f libgphobos2_t.a >+ rm -f libgphobos2.so > > check-local: unittest > ./unittest >diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in >index 93c887b..efc5fc3 100644 >--- a/libphobos/src/Makefile.in >+++ b/libphobos/src/Makefile.in >@@ -268,7 +268,9 @@ Z_OBJS = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o \ > OS_OBJS = std/file.o std/mmfile.o std/path.o std/process.o \ > std/socket.o std/socketstream.o > >-LINUX_OBJS = std/c/linux/linux.o std/c/linux/socket.o >+#LINUX_OBJS=std/c/linux/linux.o std/c/linux/socket.o >+# std/c/linux/linux.o is in D_EXTRA_OBJS >+LINUX_OBJS = std/c/linux/socket.o > OSX_OBJS = std/c/osx/socket.o > FREEBSD_OBJS = std/c/freebsd/socket.o > >@@ -513,7 +515,7 @@ uninstall-am: > uninstall-am > > >-all-local: libgphobos2.a >+all-local: libgphobos2.a libgphobos2.so > > %.o : %.d > $(GDC) -o $@ $(ALL_DFLAGS) -c $< >@@ -541,6 +543,9 @@ libgphobos2.a : $(ALL_PHOBOS_OBJS) ../libdruntime/libgdruntime.a > $(AR) -q $@ $(ALL_PHOBOS_OBJS) > $(RANLIB) $@ > >+libgphobos2.so : $(ALL_PHOBOS_OBJS) ../libdruntime/libgdruntime.so >+ $(GDC) -nophoboslib -shared -o $@ $(ALL_PHOBOS_OBJS) >+ > libgphobos2_t.a : $(ALL_PHOBOS_OBJS:.o=.t.o) > $(AR) -r $@ $(ALL_PHOBOS_OBJS:.o=.t.o) > $(RANLIB) $@ >@@ -551,10 +556,11 @@ unittest: libgphobos2.a libgphobos2_t.a unittest.o > #--------------------------------------# > # Install, doc, etc targets > >-install-exec-local: libgphobos2.a >+install-exec-local: libgphobos2.a libgphobos2.so > $(mkinstalldirs) $(DESTDIR)$(toolexeclibdir) > $(INSTALL) libgphobos2.a $(DESTDIR)$(toolexeclibdir) > $(RANLIB) $(DESTDIR)$(toolexeclibdir)/libgphobos2.a >+ $(INSTALL) libgphobos2.so $(DESTDIR)$(toolexeclibdir) > > install-data-local: libgphobos2.a > for i in etc/c \ >diff --git a/gcc/d/d-spec.cc b/gcc/d/d-spec.cc >index 18f0d18..ac2a102 100644 >--- a/gcc/d/d-spec.cc >+++ b/gcc/d/d-spec.cc >@@ -140,6 +140,9 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, > /* True if we should add -shared-libgcc to the command-line. */ > int shared_libgcc = 1; > >+ /* False if we found -static-libphobos in the original command-line. */ >+ int use_shared_libphobos = 1; >+ > /* The total number of arguments with the new stuff. */ > int argc; > >@@ -297,6 +300,10 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, > > case OPT_static_libphobos: > library = library >= 0 ? 2 : library; >+ if (use_shared_libphobos) { >+ added = 1; // force argument rebuild >+ use_shared_libphobos = 0; /*k8*/ >+ } > args[i] |= SKIPOPT; > break; > >@@ -367,7 +374,8 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, > /* There is one extra argument added here for the runtime > library: -lgphobos. The -pthread argument is added by > setting need_thread. */ >- num_args = argc + added + need_math + shared_libgcc + (library > 0) * 4 + 2; >+ /*k8: use_shared_libphobos*2 due to -lcurl and -lgdruntime*/ >+ num_args = argc + added + need_math + shared_libgcc + (library > 0) * 4 + 2 + use_shared_libphobos * 2; > new_decoded_options = XNEWVEC (cl_decoded_option, num_args); > > i = 0; >@@ -476,11 +484,25 @@ lang_specific_driver (cl_decoded_option **in_decoded_options, > } > #endif > >+ if (use_shared_libphobos) { >+ /*k8: add '-lgdruntime', cause libgphobos2.so needs it*/ >+ generate_option (OPT_l, "gdruntime", 1, CL_DRIVER, &new_decoded_options[j]); >+ added_libraries++; >+ j++; >+ } >+ > generate_option (OPT_l, saw_profile_flag ? LIBPHOBOS_PROFILE : LIBPHOBOS, 1, > CL_DRIVER, &new_decoded_options[j]); > added_libraries++; > j++; > >+ if (use_shared_libphobos) { >+ /*k8: add '-lcurl', cause libgphobos2.so needs it*/ >+ generate_option (OPT_l, "curl", 1, CL_DRIVER, &new_decoded_options[j]); >+ added_libraries++; >+ j++; >+ } >+ > #ifdef HAVE_LD_STATIC_DYNAMIC > if (library > 1 && !static_link) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 149
: 73