Opened 3 weeks ago

Last modified 3 weeks ago

#60671 assigned defect

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

Reported by: ryandesign (Ryan Schmidt) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: yosemite Cc:
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 (4)

comment:1 Changed 3 weeks 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 (and I didn't want the default llvm builds to have all the +debug stuff in them).

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

comment:3 Changed 3 weeks 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 3 weeks ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:4 Changed 3 weeks 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
Note: See TracTickets for help on using tickets.