]> 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>
Tue, 25 Feb 2025 07:31:51 +0000 (08:31 +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.

(cherry picked from commit e22962538f64bb6e5ac87977ec8a5d86f4ef21cb)

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

index 6baa838af10a27915c87e912910cb4d9a0199f6d..799fd195ec6187128be2d5a860224f7e60c28a22 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 30770d20f3db5add2f4d9ad089edfb6c50dbc0d8..66a767fd3611ea41d37e3012cba74fc716e4f8cc 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 aaa7e66888ab6082d4eb7841ecb3c4d162fb14be..b27c64603065f1b45b96b930329a3f642daf0cb1 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 1028dcb1eb3c741d517d6f4ef3a65d7c48a8f49b..b18482c7190f3830c2b39e6454fe5e6a8a139b31 100644 (file)
@@ -690,7 +690,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