SYS_open vs SYS_openat
Closed this issue · 5 comments
Working on the astra machine at Sandia National Lab, I observed a failure trying to compile gotcha-e045599 (date about 8 November 2018). Astra is an arm64 machine, so apparently wants to see SYS_openat instead of SYS_open, in gotcha_open, in src/libc_wrappers.c. The Debian project seems to have fixed a similar issue a couple of years ago with a simple macro:
https://salsa.debian.org/debian/boxbackup/commit/6a04b0abd728da5211e6702b1d42aef95c02d8da
@mplegendre , you might know some magic to query the system for whether open
or openat
is appropriate. If so, great. If not, the CMake'ism for the autotools solution would probably be something like this
Also thanks @lee-busby for testing this on Astra!
A little more followup: Running s/SYS_open/SYS_openat/
in libc_wrappers.c was sufficient to successfully build gotcha, then caliper on astra, using the gnu-7.2 compiler suite. So I can work with a local patch for the immediate future. I will try the armclang compiler suite next week.
I just pushed a fix to develop.
Doing a straight s/SYS_open/SYS_openat/ might lead to a broken-at-runtime Gotcha. There's a small parameter change between the two functions too.
@mplegendre I didn't realize that SYS_open was a preprocessor macro you could check for the definition of, that's really slick