Opened 4 years ago

Closed 21 months ago

#60671 closed defect (fixed)

ispc-clang: use of undeclared identifier 'MAP_ANONYMOUS', 'CLOCK_MONOTONIC', 'CLOCK_REALTIME', 'clock_gettime'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: yosemite Cc: chrstphrchvz (Christopher Chavez), tenomoto (Takeshi Enomoto)
Port: ispc-clang

Description

ispc-clang does not build, at least not on Yosemite:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_allocator.h:64:40: error: use of undeclared identifier 'MAP_ANONYMOUS'
                         MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                                       ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_allocator.h:113:40: error: use of undeclared identifier 'MAP_ANONYMOUS'
                         MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                                       ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_logging.cpp:34:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_controller.h:29:26: error: unknown type name 'clockid_t'; did you mean 'clock_t'?
  int (*WallClockReader)(clockid_t, struct timespec *) = 0;
                         ^~~~~~~~~
                         clock_t
/usr/include/sys/_types/_clock_t.h:30:33: note: 'clock_t' declared here
typedef __darwin_clock_t        clock_t;
                                ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_logging.cpp:34:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_controller.h:80:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
    WallClockReader(CLOCK_MONOTONIC, &TS);
                    ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_logging.cpp:433:32: error: use of undeclared identifier 'CLOCK_REALTIME'
    int result = clock_gettime(CLOCK_REALTIME, &TS);
                               ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/llvm-project-10.0.0/compiler-rt/lib/xray/xray_fdr_logging.cpp:486:58: error: use of undeclared identifier 'clock_gettime'
        FDRController<>(TLD.BQ, TLD.Buffer, *TLD.Writer, clock_gettime,
                                                         ^
6 errors generated.
make[2]: *** [projects/compiler-rt/lib/xray/CMakeFiles/RTXrayFDR.osx.dir/xray_fdr_logging.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_ispc/ispc-clang/work/build'
make[1]: *** [projects/compiler-rt/lib/xray/CMakeFiles/RTXrayFDR.osx.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

The legacysupport portgroup might solve some or all of these errors.

Change History (10)

comment:1 Changed 4 years ago by kencu (Ken)

Depending on how motivated anyone is to get this particular port to build on older systems, you'd have to basically duplicate what I have done in the llvm-10 portfile to get all the older systems working. It's not overly hard, now that we know what is needed -- copy/paste what bits are needed from the llvm-10 portfile and turn various features off, depending on the system.

There used to be another option available -- to use the existing llvm ports, and just build them with +debug enabled (ipsc uses features only in the debug build). but that option was removed not long ago in favour of this, for buildbot reasons (we didn't want the default llvm build to have all the +debug stuff in it).

Version 2, edited 4 years ago by kencu (Ken) (previous) (next) (diff)

comment:3 Changed 4 years ago by tenomoto (Takeshi Enomoto)

Thanks for pointing me to llvm-10. Should I make copies for some of the patches?

I copied the part turning off features depending on ${os.major}, but I get an error due to conflicting types for getattrlistat, same as #60481, on Yosemite. I don't see how you fixed the conflict. legacysupport.newest_darwin_requires_legacy 15 didn't help.

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 4 years ago by kencu (Ken)

all the patches would have to be rejigged as Chris is building llvm-10 a bit differently with different folder layouts. Probably not worth the effort, unless some brooding programmer on a very tight budget wants to build software with ipsc on a 2006-vintage Mac somewhere :> In which case, they can fix it.

that conflicting definition for getattrlistat has been fixed in a newer legacysupport but not rolled out yet. You could install legacy-support-devel and see if that does work here, as it is supposed to fix this.

In our clang-10 I didn't use legacysupport. I just turned off features that wouldn't build. This combo should get you down to 10.7 I think, unless ipsc actually needs one of those features, in which case back to legacy-support-devel I guess.

-DCOMPILER_RT_BUILD_XRAY=OFF
-DCLANG_ENABLE_CLANGD=OFF
-DCOMPILER_RT_BUILD_SANITIZERS=OFF
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF

comment:5 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:6 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

In fa1391cc725e20233f006ba8bfa793f19777f6ec/macports-ports (master):

ispc{-clang}: extend legacy-support to 10.11

Still needs getattrlistat(), which a future legacy-support will provide
See: #60671

comment:7 Changed 3 years ago by kencu (Ken)

no, we do have getattrlistat in there <https://github.com/macports/macports-legacy-support/blob/fea10a08147bdadcf5154b69e0352eef930550ec/src/atcalls.c#L214>.

The new release with the updated definition has happened.

I'm just working on a few more, like setattrlistat, etc.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:8 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:9 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: tenomoto added; mascguy removed
Owner: changed from tenomoto to mascguy

Taking over this ticket

comment:10 Changed 21 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

This port now builds at least as far back as 10.7, thanks to legacysupport. Closing as fixed.

Note: See TracTickets for help on using tickets.