Project

General

Profile

Bug #2765

Undefined symbols _pipe2

Added by ryandesign 8 months ago. Updated 7 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
build_autotools
Target version:
Start date:
2016-11-05
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

lighttpd 1.4.43 fails to build on OS X 10.11 El Capitan:

libtool: compile:  ccache /usr/bin/clang -DHAVE_CONFIG_H -DHAVE_VERSION_H -DLIBRARY_DIR=\"/opt/local/lib\" -DSBIN_DIR=\"/opt/local/sbin\" -I. -I.. -I/opt/local/include -D_REENTRANT -D__EXTENSIONS__ -I/opt/local/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -pipe -Os -arch x86_64 -Wall -W -Wshadow -pedantic -std=gnu99 -MT mod_cgi.lo -MD -MP -MF .deps/mod_cgi.Tpo -c mod_cgi.c  -fno-common -DPIC -o .libs/mod_cgi.o
mod_cgi.c:1083:6: warning: implicit declaration of function 'pipe2' is invalid in C99 [-Wimplicit-function-declaration]
        if (pipe_cloexec(to_cgi_fds)) {
            ^
mod_cgi.c:40:30: note: expanded from macro 'pipe_cloexec'
#define pipe_cloexec(pipefd) pipe2((pipefd), O_CLOEXEC)
                             ^
1 warning generated.
mv -f .deps/mod_cgi.Tpo .deps/mod_cgi.Plo
/bin/sh ../libtool  --tag=CC   --mode=link ccache /usr/bin/clang   -pipe -Os -arch x86_64 -Wall -W -Wshadow -pedantic -std=gnu99 -module -export-dynamic -avoid-version -no-undefined -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -o mod_cgi.la -rpath /opt/local/lib mod_cgi.lo liblightcomp.la 
libtool: link: ccache /usr/bin/clang  -o .libs/mod_cgi.so -bundle  .libs/mod_cgi.o   -L/opt/local/lib ./.libs/liblightcomp.dylib -lpcre -lssl -lcrypto -lev  -Os -arch x86_64 -Wl,-headerpad_max_install_names -arch x86_64  
Undefined symbols for architecture x86_64:
  "_pipe2", referenced from:
      _mod_cgi_handle_subrequest in mod_cgi.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [mod_cgi.la] Error 1
main.log (225 KB) main.log ryandesign, 2016-11-05 07:03

Associated revisions

Revision 65330562 (diff)
Added by gstrauss 7 months ago

[mod_cgi] FreeBSD 9.3/MacOSX does not have pipe2() (fixes #2765)

FreeBSD 9.3 has O_CLOEXEC, but does not have pipe2() until FreeBSD 10.
FreeBSD 10 also adds SOCK_CLOEXEC, so use that as indicator
https://wiki.freebsd.org/AtomicCloseOnExec

Note: FreeBSD 9.3 will soon reach its "extended" EOL date (31 Dec 2016),
so those using FreeBSD 9.3 should consider upgrading.
https://www.freebsd.org/security/security.html#sup

Mac OS X does not have pipe2(). User reported:
Undefined symbols for architecture x86_64:
"_pipe2", referenced from:
_mod_cgi_handle_subrequest in mod_cgi.o

x-ref:
"Undefined symbols _pipe2"
https://redmine.lighttpd.net/issues/2765

History

#1 Updated by gstrauss 8 months ago

  • Target version changed from 1.4.x to 1.4.44

temporary workaround for Mac OS X in mod_cgi.c where pipe_cloexec is defined

-#if defined(O_CLOEXEC) && (!defined(__FreeBSD__) || defined(F_DUPFD_CLOEXEC))
+#if defined(O_CLOEXEC) && 0

#2 Updated by gstrauss 7 months ago

Related, not supported in (old) FreeBSD 9.3: http://redmine.lighttpd.net/boards/2/topics/6926

#3 Updated by gstrauss 7 months ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Also available in: Atom