]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
jit/118780 - make sure to include dlfcn.h when plugin support is disabled
authorRichard Biener <rguenther@suse.de>
Fri, 7 Feb 2025 13:42:23 +0000 (14:42 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 7 Feb 2025 15:01:46 +0000 (16:01 +0100)
The following makes the dlfcn.h explicitly requested which avoids
build failure when JIT is enabled but plugin support disabled as
currently the include is conditional on plugin support.

PR jit/118780
gcc/
* system.h: Check INCLUDE_DLFCN_H for including dlfcn.h instead
of ENABLE_PLUGIN.
* plugin.cc: Define INCLUDE_DLFCN_H.

gcc/jit/
* jit-playback.cc: Define INCLUDE_DLFCN_H.
* jit-result.cc: Likewise.

gcc/jit/jit-playback.cc
gcc/jit/jit-result.cc
gcc/plugin.cc
gcc/system.h

index c9fcebc4730aebfeb2198638f0b30e5bff7b7559..6946f100d5ccfb1b9bf3349ca4452f5ed3cc57a7 100644 (file)
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "config.h"
 #define INCLUDE_MUTEX
+#define INCLUDE_DLFCN_H
 #include "libgccjit.h"
 #include "system.h"
 #include "coretypes.h"
index 1c793aef0623cd343fa57fd2c7eae6ed16b3f682..2ad6deb1da8c6fc7415fb9ff38124122e351f0b6 100644 (file)
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
+#define INCLUDE_DLFCN_H
 #include "system.h"
 #include "coretypes.h"
 
index 6d3394908fc82aa5da1af642542fd5356821715a..0de2cc2dd2c2d6b1ba81963bbc788067a637124b 100644 (file)
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3.  If not see
    APIs described in doc/plugin.texi.  */
 
 #include "config.h"
+#define INCLUDE_DLFCN_H
 #include "system.h"
 #include "coretypes.h"
 #include "options.h"
index 39d28ba0bb408562541b94ee9ea1e8b8938cf38a..e516b49d04a78d3183aa9c248f4afed8aeb4cb3a 100644 (file)
@@ -694,7 +694,7 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
 # endif
 #endif
 
-#if defined (ENABLE_PLUGIN) && defined (HAVE_DLFCN_H)
+#if defined (INCLUDE_DLFCN_H) && defined (HAVE_DLFCN_H)
 /* If plugin support is enabled, we could use libdl.  */
 #include <dlfcn.h>
 #endif