(unknown)

Ileana Dumitrescu <[email protected]> Sat, 6 Sep 2025 07:44:47 -0400 (EDT)
Newsgroups gmane.comp.gnu.libtool.cvs
Message-ID <[email protected]>
branch: master
commit 4d00c3624d0a2f11442761a154a983031f9cb1c2
Author: Ileana Dumitrescu <[email protected]>
AuthorDate: Sat Aug 9 14:22:47 2025 +0300

    New Intel OneAPI compiler names
    
    Reported: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78817
    
    * libltdl/libltdl/lt__alloc.h: Change FREE and MEMREASSIGN macros for
      -Wcompound-token-split-by-macro.
    * libltdl/libltdl/lt_system.h: Change LT_STMT_START and LT_STMT_END
      macros for -Wcompound-token-split-by-macro.
    * libltdl/loaders/loadlibrary.c: Add support for icx, icpx, ifx.
    * libltdl/ltdl.c: Fixes for Clang.
    * m4/libtool.m4: Add support for icx, icpx, and ifx.
    * NEWS: Update.
---
 NEWS                          |  4 ++++
 libltdl/libltdl/lt__alloc.h   |  8 ++++----
 libltdl/libltdl/lt_system.h   | 12 ++++++------
 libltdl/loaders/loadlibrary.c |  4 ++--
 libltdl/ltdl.c                | 34 ++++++++++++++++++++--------------
 m4/libtool.m4                 | 23 ++++++++++++-----------
 6 files changed, 48 insertions(+), 37 deletions(-)

diff --git a/NEWS b/NEWS
index e7169270..b167fd74 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,10 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 
   - Fix libltdl early failures for multi-arch.
 
+** Changes in supported systems or compilers:
+
+  - Support additional Intel OneAPI compilers, 'icx', 'icpx', and 'ifx'.
+
 
 * Noteworthy changes in release 2.5.4 (2024-11-20) [stable]
 
diff --git a/libltdl/libltdl/lt__alloc.h b/libltdl/libltdl/lt__alloc.h
index f27345b1..ad25e30e 100644
--- a/libltdl/libltdl/lt__alloc.h
+++ b/libltdl/libltdl/lt__alloc.h
@@ -35,11 +35,11 @@ LT_BEGIN_C_DECLS
 
 #define MALLOC(tp, n)		(tp*) lt__malloc((n) * sizeof(tp))
 #define REALLOC(tp, mem, n)	(tp*) lt__realloc((mem), (n) * sizeof(tp))
-#define FREE(mem)				LT_STMT_START {	\
-	free (mem); mem = NULL;					} LT_STMT_END
-#define MEMREASSIGN(p, q)			LT_STMT_START {	\
+#define FREE(mem)				LT_STMT_START \
+	free (mem); mem = NULL;					LT_STMT_END
+#define MEMREASSIGN(p, q)			LT_STMT_START \
 	if ((p) != (q)) { free (p); (p) = (q); (q) = 0; }	\
-								} LT_STMT_END
+								LT_STMT_END
 
 /* If set, this function is called when memory allocation has failed.  */
 LT_SCOPE void (*lt__alloc_die) (void);
diff --git a/libltdl/libltdl/lt_system.h b/libltdl/libltdl/lt_system.h
index 15346858..2f2c7b77 100644
--- a/libltdl/libltdl/lt_system.h
+++ b/libltdl/libltdl/lt_system.h
@@ -62,15 +62,15 @@ License along with GNU Libltdl.  If not, see <https://www.gnu.org/licenses/>.
 /* LT_STMT_START/END are used to create macros that expand to a
    a single compound statement in a portable way.  */
 #if defined  __GNUC__ && !defined  __STRICT_ANSI__ && !defined  __cplusplus
-#  define LT_STMT_START        (void)(
-#  define LT_STMT_END          )
+#  define LT_STMT_START        (void)({
+#  define LT_STMT_END          })
 #else
 #  if (defined sun || defined __sun__)
-#    define LT_STMT_START      if (1)
-#    define LT_STMT_END        else (void)0
+#    define LT_STMT_START      if (1){
+#    define LT_STMT_END        }else (void)0
 #  else
-#    define LT_STMT_START      do
-#    define LT_STMT_END        while (0)
+#    define LT_STMT_START      do{
+#    define LT_STMT_END        }while (0)
 #  endif
 #endif
 
diff --git a/libltdl/loaders/loadlibrary.c b/libltdl/loaders/loadlibrary.c
index e1176bd7..d62dce5b 100644
--- a/libltdl/loaders/loadlibrary.c
+++ b/libltdl/loaders/loadlibrary.c
@@ -95,8 +95,8 @@ get_vtable (lt_user_data loader_data)
 
 #include <windows.h>
 
-#define LOCALFREE(mem)					     LT_STMT_START { \
-	if (mem) { LocalFree ((void *)mem); mem = NULL; }    } LT_STMT_END
+#define LOCALFREE(mem)					     LT_STMT_START \
+	if (mem) { LocalFree ((void *)mem); mem = NULL; }    LT_STMT_END
 #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg))
 #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode))
 
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 60495415..85bd6013 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1367,9 +1367,12 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 	    }
 #endif
 #if defined LT_DLSEARCH_PATH
-	  if (!file && *sys_dlsearch_path)
+	  if (!file)
 	    {
-	      file = find_file (sys_dlsearch_path, base_name, &dir);
+	      if (*sys_dlsearch_path)
+	        {
+	          file = find_file (sys_dlsearch_path, base_name, &dir);
+	        }
 	    }
 #endif
 	}
@@ -1916,24 +1919,27 @@ lt_dlforeachfile (const char *search_path,
       is_done = foreach_dirinpath (user_search_path, 0,
 				   foreachfile_callback, fpptr, data);
       if (!is_done)
-	{
-	  is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0,
+	      {
+	        is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0,
 				       foreachfile_callback, fpptr, data);
-	}
+	      }
 
 #if defined LT_MODULE_PATH_VAR
       if (!is_done)
-	{
-	  is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0,
-				       foreachfile_callback, fpptr, data);
-	}
+      {
+          is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0,
+               foreachfile_callback, fpptr, data);
+      }
 #endif
 #if defined LT_DLSEARCH_PATH
-      if (!is_done && *sys_dlsearch_path)
-	{
-	  is_done = foreach_dirinpath (sys_dlsearch_path, 0,
-				       foreachfile_callback, fpptr, data);
-	}
+      if (!is_done)
+	      {
+          if (*sys_dlsearch_path)
+            {
+              is_done = foreach_dirinpath (sys_dlsearch_path, 0,
+                   foreachfile_callback, fpptr, data);
+            }
+        }
 #endif
     }
 
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index ffc8a3e1..cb869809 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2668,8 +2668,8 @@ m4_if([$1], [],[
     dynamic_linker='Win32 ld.exe'
     ;;
 
-  *,cl* | *,icl*)
-    # Native MSVC or ICC
+  *,cl* | *,icl* | *,icx*)
+    # Native MSVC and Intel compilers
     libname_spec='$name'
     soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
     library_names_spec='$libname.dll.lib'
@@ -4558,7 +4558,7 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 	    ;;
-	  icpc* )
+	  icpc* | icpx*)
 	    # Intel C++, used to be incompatible with GCC.
 	    # ICC 10 doesn't accept -KPIC any more.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -4893,7 +4893,7 @@ m4_if([$1], [CXX], [
         ;;
       # icc used to be incompatible with GCC.
       # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
+      icc* | ifort* | icx* | ifx*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -5129,7 +5129,8 @@ m4_if([$1], [CXX], [
     ;;
   cygwin* | mingw* | windows* | cegcc*)
     case $cc_basename in
-    cl* | icl*)
+    cl* | icl* | icx* | icpx*)
+      # Native MSVC and Intel compilers
       _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
       ;;
     *)
@@ -5404,7 +5405,7 @@ _LT_EOF
 	  tmp_addflag=' -i_dynamic' ;;
 	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
 	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
+	ifc* | ifort* | ifx*)		# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
@@ -5767,8 +5768,8 @@ _LT_EOF
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       case $cc_basename in
-      cl* | icl*)
-	# Native MSVC or ICC
+      cl* | icl* | icx* | icpx*)
+	# Native MSVC and Intel compilers
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	_LT_TAGVAR(always_export_symbols, $1)=yes
@@ -6851,8 +6852,8 @@ if test yes != "$_lt_caught_CXX_error"; then
 
       cygwin* | mingw* | windows* | pw32* | cegcc*)
 	case $GXX,$cc_basename in
-	,cl* | no,cl* | ,icl* | no,icl*)
-	  # Native MSVC or ICC
+	,cl* | no,cl* | ,icl* | no,icl* | ,icx* | no,icx* | ,icpx* | no,icpx*)
+	  # Native MSVC and Intel compilers
 	  # hardcode_libdir_flag_spec is actually meaningless, as there is
 	  # no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@@ -7186,7 +7187,7 @@ if test yes != "$_lt_caught_CXX_error"; then
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 	    ;;
-	  icpc* | ecpc* )
+	  icpc* | ecpc* | icpx*)
 	    # Intel C++
 	    with_gnu_ld=yes
 	    # version 8.0 and above of icpc choke on multiply defined symbols