Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hurd build fixes from Debian #627

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

markhindley
Copy link
Contributor

PR as requested in #626

Mark

Copy link
Member

@vapier vapier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ftbfs" is a Debian thing and isn't common outside that space. just write out the term or appropriate alternative.

meson.build Outdated
@@ -43,7 +43,7 @@ else
os = option_os
endif

if os != 'Linux'
if os != 'Linux' and os != 'GNU'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a new issue, but this check seems to assume that we always want kvm on non-Linux systems. this should really be changed to only require kvm on BSD systems

@@ -21,10 +21,8 @@

#define ONE_MS 1000000

#ifdef __linux__
/* For extra SCHED_* defines. */
/* For extra SCHED_* defines and pipe2. */
# define _GNU_SOURCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't leave it indented

@@ -21,10 +21,8 @@

#define ONE_MS 1000000

#ifdef __linux__
/* For extra SCHED_* defines. */
/* For extra SCHED_* defines and pipe2. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pipe2 usage implies a bigger problem here i think. we're using it unprotected. we really need a test in meson to see if the system supports pipe2 and switch between it & standard pipe.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this is correct, OTOH it seems that pipe2() is available in all the OSes for which there is some kind of support in OpenRC:

so adding a meson test for it with fallback to pipe() would effectively create dead code, because it would not be used on any of the supported OSes; considering that currently pipe2() is used unconditionally without issues, IMHO it would be acceptable to keep using it like that, and wait until anyone tries to port OpenRC to another OS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see if the system supports pipe2 and switch between it & standard pipe.

I haven't taken a look into the usage yet, so this might not be a problem, but pipe2 and pipe + fcntl aren't functionally equivalent.

With pipe + fcntl there exists a window between these two calls where the fd might not have proper mode set. This can become an issue in multi-threaded or signal handler contexts.

@markhindley markhindley changed the title Hurd ftbfs fixes from Debian Hurd build fixes from Debian Apr 25, 2023
FAILED: src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o
cc -Isrc/start-stop-daemon/start-stop-daemon.p -Isrc/start-stop-daemon -I../src/start-stop-daemon -Isrc/shared -I../src/shared -Isrc/libeinfo -I../src/libeinfo -Isrc/librc -I../src/librc -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c99 -D_DEFAULT_SOURCE -DMAXPATHLEN=4096 -DPATH_MAX=4096 -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wformat=2 -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wsequence-point -Wshadow -Wwrite-strings -Werror=implicit-function-declaration -DHAVE_MALLOC_EXTENDED_ATTRIBUTE -DHAVE_CLOSEFROM -DHAVE_CLOSE_RANGE_CLOEXEC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -MD -MQ src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o -MF src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o.d -o src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o -c ../src/start-stop-daemon/start-stop-daemon.c
../src/start-stop-daemon/start-stop-daemon.c: In function ‘main’:
../src/start-stop-daemon/start-stop-daemon.c:865:13: error: implicit declaration of function ‘pipe2’; did you mean ‘pipe’? [-Werror=implicit-function-declaration]
  865 |         if (pipe2(pipefd, O_CLOEXEC) == -1)
      |             ^~~~~
      |             pipe

Although this is triggered on HURD, according to glibc pipe2(2), this is
required for the 2 argument form irresepctive of arch.

SYNOPSIS
       #include <unistd.h>

       int pipe(int pipefd[2]);

       #define _GNU_SOURCE             /* See feature_test_macros(7) */
       #include <fcntl.h>              /* Definition of O_* constants */
       #include <unistd.h>

       int pipe2(int pipefd[2], int flags);
../meson.build:47:2: ERROR: C shared or static library 'kvm' not found
@vapier
Copy link
Member

vapier commented May 11, 2023

these commits are better and i don't think make the status quo worse, but i still think we should fix the regression around pipe2 rather than make it a hard requirement

meson.build Outdated Show resolved Hide resolved
Co-authored-by: Pino Toscano <[email protected]>
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.

4 participants