Skip to content

Include sys/syscall.h to appease g++-16 - #6

Open
eddelbuettel wants to merge 1 commit into
gabime:mainfrom
eddelbuettel:bugfix/added_header_g++-16
Open

Include sys/syscall.h to appease g++-16#6
eddelbuettel wants to merge 1 commit into
gabime:mainfrom
eddelbuettel:bugfix/added_header_g++-16

Conversation

@eddelbuettel

Copy link
Copy Markdown
Contributor

When compiling under g++-16 (here on Debian-based container) we now fail for a lack of sys/syscall.h which is likely due to another round of tighter include management. The fail is from my R package rspdlite, it treats spdlite in a fairly vanilla way (not using cmake because of the way R builds packages):

g++-16 -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/reproducible-path/r-base-4.6.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2   -c formatter.cpp -o formatter.o
In file included from ../inst/include/spdlite/logger.h:19,
                 from ../inst/include/rspdlite:8,
                 from formatter.cpp:5:
../inst/include/spdlite/formatter.h: In lambda function:
../inst/include/spdlite/formatter.h:33:52: error: ‘SYS_gettid’ was not declared in this scope; did you mean ‘gettid’?
   33 |         raw = static_cast<std::uint64_t>(::syscall(SYS_gettid));
      |                                                    ^~~~~~~~~~
      |                                                    gettid
make: *** [/usr/lib/R/etc/Makeconf:199: formatter.o] Error 1
ERROR: compilation failed for package ‘rspdlite’

One we add the line this PR adds conditional on being on Linux, things work:

g++-16 -std=gnu++20 -I"/usr/share/R/include" -DNDEBUG -I../inst/include -I'/usr/lib/R/site-library/Rcpp/include'     -fpic  -g -O2 -ffile-prefix-map=/build/reproducible-path/r-base-4.6.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2   -c formatter.cpp -o formatter.o
g++-16 -std=gnu++20 -shared -L/usr/lib/R/lib -Wl,-z,relro -o rspdlite.so RcppExports.o formatter.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-work/00new/rspdlite/libs

I can detail this more or provide a standalone reproducible example if you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant