octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #8919] Start of patch to enable visibility


From: Markus Mützel
Subject: [Octave-patch-tracker] [patch #8919] Start of patch to enable visibility attributes for GCC in build system
Date: Wed, 23 Dec 2020 12:41:07 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66

Follow-up Comment #16, patch #8919 (project octave):

This was probably the reason why there were separate macros for each library.
For the win32 target, we need separate definitions for export and import of
the symbols.
This seems actually to be platform specific (not compiler specific):
https://gcc.gnu.org/wiki/Visibility#How_to_use_the_new_C.2B-.2B-_visibility_support

I currently trying with this change:

diff -r 636c49a35d2e -r 653683b44222 configure.ac
--- a/configure.ac      Wed Dec 23 13:30:26 2020 +0100
+++ b/configure.ac      Wed Dec 23 18:37:58 2020 +0100
@@ -2488,7 +2488,6 @@
         else
           JAVA_CPPFLAGS="-I\"${JAVA_HOME}/include\"
-I\"${JAVA_HOME}/include/win32\""
         fi
-        LDFLAGS="$LDFLAGS -Wl,--export-all-symbols"
       fi
       AC_DEFINE(HAVE_JAVA, 1,
         [Define to 1 if Java is available and is at least version 1.5])
diff -r 636c49a35d2e -r 653683b44222 oct-conf-post.in.h
--- a/oct-conf-post.in.h        Wed Dec 23 13:30:26 2020 +0100
+++ b/oct-conf-post.in.h        Wed Dec 23 18:37:58 2020 +0100
@@ -173,9 +173,16 @@
 /* FIXME: GCC supports visibility attributes as well, even using the
    same __declspec declaration if desired.  The build system should be
    extended to support GCC and visibility attributes.  */
-#if defined (_MSC_VER)
-#  define OCTAVE_EXPORT __declspec(dllexport)
-#  define OCTAVE_IMPORT __declspec(dllimport)
+#if defined (_WIN32) || defined (__CYGWIN__)
+#  if defined (__GNUC__)
+/* GCC */
+#    define OCTAVE_EXPORT __attribute__ ((dllexport))
+#    define OCTAVE_IMPORT __attribute__ ((dllimport))
+#  else
+/* MSVC */
+#    define OCTAVE_EXPORT __declspec(dllexport)
+#    define OCTAVE_IMPORT __declspec(dllimport)
+#  endif
 #else
    /* All other compilers, at least for now. */
 #  define OCTAVE_EXPORT __attribute__ ((visibility ("default")))


But this will probably fail because we'd need to define OCTAVE_API to
OCTAVE_IMPORT for the headers belonging to libraries we currently *don't*
compile...


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?8919>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]