Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63479 closed defect (fixed)

emacs{,-app}-devel+nativecomp @20210910: configure fails when gcc10 is also installed

Reported by: amake (Aaron Madlon-Kay) Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: emacs-devel, emacs-app-devel

Description

The configure phase fails on a check for libgccjit when both gcc11 (direct dependency) and gcc10 (which I happened to also have installed) are present.

Deactivating gcc10 allowed the port to build successfully.

From config.log:

configure:16827: checking for gcc_jit_context_acquire in -lgccjit
configure:16850: /usr/bin/clang -o conftest -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 -I/opt/local/include/librsvg-2.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/ossp -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I   -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-no_pie -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 -L conftest.c -lgccjit    >&5
ld: warning: -L path 'conftest.c' is not a directory
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:16850: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Emacs"
| #define PACKAGE_TARNAME "emacs"
| #define PACKAGE_VERSION "28.0.50"
| #define PACKAGE_STRING "GNU Emacs 28.0.50"
| #define PACKAGE_BUGREPORT "bug-gnu-emacs@gnu.org"
| #define PACKAGE_URL "https://www.gnu.org/software/emacs/"
| #define HAVE_PDUMPER 1
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_PWD_H 1
| #define HAVE_UTMP_H 1
| #define HAVE_UTIL_H 1
| #define HAVE_SANITIZER_LSAN_INTERFACE_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_PTHREAD_H 1
| #define HAVE_MALLOC_MALLOC_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_DIRENT_H 1
| #define HAVE_EXECINFO_H 1
| #define HAVE_GETOPT_H 1
| #define HAVE_SYS_CDEFS_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_RANDOM_H 1
| #define STDC_HEADERS 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _HPUX_ALT_XOPEN_SOCKET_API 1
| #define _NETBSD_SOURCE 1
| #define _OPENBSD_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
| #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_DFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
| #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
| #define __STDC_WANT_LIB_EXT2__ 1
| #define __STDC_WANT_MATH_SPEC_FUNCS__ 1
| #define _TANDEM_SOURCE 1
| #define __EXTENSIONS__ 1
| #define SYSTEM_TYPE "darwin"
| #define HAVE_TERM_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_NET_IF_H 1
| #define HAVE_IFADDRS_H 1
| #define HAVE_NET_IF_DL_H 1
| #define HAVE_STRUCT_IFREQ_IFR_FLAGS 1
| #define HAVE_STRUCT_IFREQ_IFR_BROADADDR 1
| #define HAVE_STRUCT_IFREQ_IFR_ADDR 1
| #define HAVE_STRUCT_IFREQ_IFR_ADDR_SA_LEN 1
| #define HAVE_NATIVE_IMAGE_API 1
| #define NS_SELF_CONTAINED 1
| #define NATIVE_OBJC_INSTANCETYPE 1
| #define HAVE_SBRK 1
| #define HAVE_GETPAGESIZE 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_FCHMOD 1
| #define HAVE_FACCESSAT 1
| #define HAVE_REALPATH 1
| #define HAVE_LSTAT 1
| #define HAVE_READLINKAT 1
| #define HAVE_MEMSET_S 1
| #define HAVE_FCHMODAT 1
| #define HAVE_LCHMOD 1
| #define HAVE_FCNTL 1
| #define HAVE_FDOPENDIR 1
| #define HAVE_FSTATAT 1
| #define HAVE_FSYNC 1
| #define HAVE_FUTIMENS 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_MKOSTEMP 1
| #define HAVE_PSELECT 1
| #define HAVE_PTHREAD_SIGMASK 1
| #define HAVE_READLINK 1
| #define HAVE_ISBLANK 1
| #define HAVE_ISWCTYPE 1
| #define HAVE_STRTOIMAX 1
| #define HAVE_SYMLINK 1
| #define HAVE_LOCALTIME_R 1
| #define HAVE_TIMEGM 1
| #define HAVE_UTIMENSAT 1
| #define HAVE_GETDTABLESIZE 1
| #define HAVE_FUTIMES 1
| #define HAVE_LUTIMES 1
| #define SYSTEM_MALLOC 1
| #define HAVE_MMAP 1
| #define HAVE_PTHREAD 1
| #define THREADS_ENABLED 1
| #define HAVE_RSVG 1
| #define HAVE_GNUTLS 1
| #define HAVE_JSON 1
| #define HAVE_KQUEUE 1
| #define USE_FILE_NOTIFY 1
| #define USE_TOOLKIT_SCROLL_BARS 1
| #define HAVE_XIM 1
| #define USE_XIM 1
| #define XRegisterIMInstantiateCallback_arg6 XPointer
| #define HAVE_JPEG 1
| #define HAVE_LCMS2 1
| #define HAVE_ZLIB 1
| #define HAVE_DLADDR 1
| #define HAVE_MODULES 1
| #define MODULES_SUFFIX ".dylib"
| #define MODULES_SECONDARY_SUFFIX ".so"
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| char gcc_jit_context_acquire ();
| int
| main (void)
| {
| return gcc_jit_context_acquire ();
|   ;
|   return 0;
| }
configure:16860: result: no
configure:16870: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.

Change History (5)

comment:1 Changed 3 years ago by amake (Aaron Madlon-Kay)

Summary: emacs{,-app}-devel+nativecomp 20210910: configure fails when gcc10 is also installedemacs{,-app}-devel+nativecomp @20210910: configure fails when gcc10 is also installed

comment:2 Changed 3 years ago by drkp (Dan Ports)

Status: assignedaccepted

Yep, looks like a bug in the configure script.

comment:3 Changed 3 years ago by drkp (Dan Ports)

Interesting that the config script actually checks if MacPorts is installed and essentially does a port installed gcc* in order to look for libgccjit. At any rate, it breaks if there's more than one gcc port installed. I have a patch and I'll send it upstream.

comment:4 Changed 3 years ago by drkp (Dan Ports)

Resolution: fixed
Status: acceptedclosed

In 37aab8522642178f9e823a4588faf528a87f3530/macports-ports (master):

emacs-app-devel: update to 20210917, fix libgccjit detection

The version update includes a fix for
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50534
and the config patch fixes detection of libgccjit when multiple gcc
ports are installed.

Closes: #63479
Closes: https://github.com/macports/macports-ports/pull/12228

comment:5 Changed 3 years ago by catap (Kirill A. Korinsky)

In 328170be09e6bc2f9449834f26fb92b791f316a6/macports-ports (master):

emacs{-app}-devel: update to 2021-09-28

This change contains the final fixes for
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50534

It also includes fix for #63479

Note: See TracTickets for help on using tickets.