Opened 7 weeks ago

Last modified 7 days ago

#61130 new defect

gcc8: jit/jit-result.c:52:3: error: 'dlclose' was not declared in this scope

Reported by: kencu (Ken) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: landonf (Landon Fuller), chrstphrchvz (Christopher Chavez), dsedivec
Port: gcc8

Description

The recent update to all the gcc versions to include jit code has broken the 32bit builds, at least on 10.6 where I live.

<https://build.macports.org/builders/ports-10.6_i386-builder/builds/16987/steps/install-port/logs/stdio>

The i386 build is broken, and the universal build is also broken.

I've pegged back my gcc version to the pre-jit version on suitable systems until this is sorted out.

I haven't tried the full gamut of all the gcc versions on all possible systems yet, as I don't have 102,000 days to devote to that project :>

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:52:3: error: 'dlclose' was not declared in this scope
   dlclose (m_dso_handle);
   ^~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:52:3: note: suggested alternative: 'close'
   dlclose (m_dso_handle);
   ^~~~~~~
   close
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c: In member function 'void* gcc::jit::result::get_code(const char*)':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:78:3: error: 'dlerror' was not declared in this scope
   dlerror ();
   ^~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:78:3: note: suggested alternative: 'perror'
   dlerror ();
   ^~~~~~~
   perror
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:80:10: error: 'dlsym' was not declared in this scope
   code = dlsym (m_dso_handle, funcname);
          ^~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c: In member function 'void* gcc::jit::result::get_global(const char*)':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:105:3: error: 'dlerror' was not declared in this scope
   dlerror ();
   ^~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:105:3: note: suggested alternative: 'perror'
   dlerror ();
   ^~~~~~~
   perror
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-result.c:107:12: error: 'dlsym' was not declared in this scope
   global = dlsym (m_dso_handle, name);
            ^~~~~
make[3]: *** [jit/jit-result.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c: In member function 'gcc::jit::result* gcc::jit::playback::context::dlopen_built_dso()':
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2599:3: error: 'dlerror' was not declared in this scope
   dlerror ();
   ^~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2599:3: note: suggested alternative: 'error'
   dlerror ();
   ^~~~~~~
   error
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2602:6: error: 'RTLD_NOW' was not declared in this scope
      RTLD_NOW | RTLD_LOCAL);
      ^~~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2602:6: note: suggested alternative: 'CLD_NOOP'
      RTLD_NOW | RTLD_LOCAL);
      ^~~~~~~~
      CLD_NOOP
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2602:17: error: 'RTLD_LOCAL' was not declared in this scope
      RTLD_NOW | RTLD_LOCAL);
                 ^~~~~~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2602:17: note: suggested alternative: 'TV_LOAD'
      RTLD_NOW | RTLD_LOCAL);
                 ^~~~~~~~~~
                 TV_LOAD
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2601:12: error: 'dlopen' was not declared in this scope
   handle = dlopen (m_tempdir->get_path_so_file (),
            ^~~~~~
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.4.0/gcc/jit/jit-playback.c:2601:12: note: suggested alternative: 'open'
   handle = dlopen (m_tempdir->get_path_so_file (),
            ^~~~~~
            open
make[3]: *** [jit/jit-playback.o] Error 1

Change History (7)

comment:1 Changed 7 weeks ago by kencu (Ken)

I understand the jit is mostly to support building some kind of lisp code compiler on to be used on emacs (none of which I would ever use)?

Perhaps that is more of niche project, than something needed in the general gcc ports?

Or hopefully this is isn't too hard to fix, with some missing header perhaps.

comment:2 Changed 7 weeks ago by kencu (Ken)

Cc: landonf added

comment:3 Changed 3 weeks ago by chrstphrchvz (Christopher Chavez)

These functions are defined in dlfcn.h; is that being properly included in gcc/system.h, which in turn jit-result.c and jit-playback.c include?

comment:4 Changed 3 weeks ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:5 Changed 3 weeks ago by kencu (Ken)

include is being blocked somehow.

comment:6 Changed 3 weeks ago by kencu (Ken)

Thre is some information about building gcc with the jit here <https://gcc.gnu.org/onlinedocs/gcc-10.2.0/jit/internals/index.html>.

Notably, apparently this slows down gcc, so they recommend separate builds, using the standard build for most everything, and the jit build to install the jit bits.

Debian and Homebrew have the libgccjit component as a separate installation from gcc itself for this reason, kind of how we have libomp as a separate installation from the lvvm tree.

We should probably do that with our libgccjit as well.

comment:7 Changed 7 days ago by dsedivec

Cc: dsedivec added
Note: See TracTickets for help on using tickets.