Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832134 - www-servers/nginx-1.21.6: fails to link with pcre2?
Summary: www-servers/nginx-1.21.6: fails to link with pcre2?
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-01-26 22:30 UTC by Zdravko Spoljar
Modified: 2022-07-14 08:53 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log upload (build.log,214.89 KB, text/x-log)
2022-01-26 22:39 UTC, Zdravko Spoljar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdravko Spoljar 2022-01-26 22:30:37 UTC
ebuild fail linking with -lpcre2.
nginx-1.21.4 use -lpcre and that passes. 

Reproducible: Always

Steps to Reproduce:
1. emerge -v1 nginx    on current portage
2.
3.
Actual Results:  
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:350: objs/nginx] Error 1
make[1]: Leaving directory '/var/tmp/portage/www-servers/nginx-1.21.6/work/nginx-1.21.6'
make: *** [Makefile:10: build] Error 2
 * ERROR: www-servers/nginx-1.21.6::gentoo failed (compile phase):


Expected Results:  
emerge success

Portage 3.0.30 (python 3.9.9-final-0, default/linux/amd64/17.1/no-multilib, gcc-11.2.0, glibc-2.33-r7, 5.15.16 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.15.16-x86_64-Intel-R-_Core-TM-_i7-7700HQ_CPU_@_2.80GHz-with-glibc2.33
KiB Mem:    16315288 total,   8754496 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Wed, 26 Jan 2022 09:00:01 +0000
Head commit of repository gentoo: 6593fe642942bc22ddf1cb5a9e83361833b05d7c
sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p8::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           3.9.9-r1::gentoo, 3.10.0_p1-r1::gentoo
dev-lang/rust:             1.58.1::gentoo
dev-util/cmake:            3.21.4::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.25::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.4::gentoo
sys-devel/binutils:        2.37_p1::gentoo
sys-devel/binutils-config: 5.4::gentoo
sys-devel/clang:           13.0.0::gentoo
sys-devel/gcc:             11.2.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.0::gentoo
sys-devel/llvm:            13.0.0::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.10::gentoo (virtual/os-headers)
sys-libs/glibc:            2.33-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: no

localOverlay
    location: /usr/local/portage
    masters: gentoo

palemoon
    location: /var/lib/layman/palemoon
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.0/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe "
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB en_US hr"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X Xaw3d aac acl acpi ads aim alsa amd64 apache2 apng athena audiofile avi bitmap-fonts bsf btrfs bzip2 cairo calendar cdparanoia cdr cilk cli corefonts crypt css ctype cups curl dbus dbx device-mapper dia dio divx4linux dlz dmx dot dri dvd dvdr dvdread dxr3 egl encode ethreal evo examples exif fbcon fbdev ffmpeg fglrx flac flatfile fontconfig fortran fpm freetds ftp fuse gb gcj gd gdbm gif gimp gimpprint git glamor glitz glut gnuplot gnutls go gpm gs gtk gudev heif hpijs http2 hwdb iconv icq idn ieee1394 imagemagick imap imlib infinality inifile inkjar innodb jabber javascript jbig jce jemalloc joystick jpeg jpeg2k junit laptop lcms ldap lesstif libg++ libglvnd libkms libtirpc libwww lua luajit lvm mad maildir mbox mcal mikmod mmap mmx mng mod motif mozilla mozsvg mp3 mpeg msn musepack mysql mysqli ncurses nfs nfsv3 nfsv4 nls nocd nptl ogg openal opengl openmp openssl oscar pam pcmcia pcre pdf pdo pear perl phonon php plotutils png policykit postgres postscript qt qt5 quicktime raw readline recode samba scanner seccomp session sharedmem slp sndfile snmp soap sockets source spdy spell split-usr sql sqlite sqlite3 sse sse2 sse4 ssl ssse3 stroke subversion svg sysvipc tcpd theora threads tiff truetype truetype-fonts type1-fonts unicode usb uudeview vala vcd vdpau visualization vorbis webkit webp webstart wifi win32codecs wmf x264 xattr xcb xfs xine xinerama xinetd xkb xml xml2 xmlreader xmlrpc xmlrps xmlwriter xmp xorg xorgmodule xpm xrandr xslt xulrunner xv xvfb xvid zip zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="brotli md watchdog log_forensic http2 cgi asis remoteip ratelimit reqtimeout proxy_fcgi slotmem_shm unixd access_compat actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias proxy_html xml2enc" APACHE2_MPMS="event" CALLIGRA_FEATURES="braindump flow karbon kexi krita sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics void" KERNEL="linux" L10N="en en-US hr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access auth_basic autoindex browser cache_purge empty_gif fastcgi flv geo geoip gzip gzip_static headers_more limit_req lua map memcached metrics proxy realip referer rewrite split_clients stub_status upstream_ip_hash upstream_check upstream_hash upstream_keepalive upstream_least_conn upstream_zone userid vhost_traffic_status" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="nvidia v4l vga fbdev" VOICEMAIL_STORAGE="file" XTABLES_ADDONS="tarpit delude logmark sysrq quota2 length2 ipmark chaos lscan psd"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LANG, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-26 22:31:56 UTC
Pleas attach the full build.log.
Comment 2 Zdravko Spoljar 2022-01-26 22:39:22 UTC
Created attachment 763688 [details]
build.log upload
Comment 3 Zdravko Spoljar 2022-01-27 23:36:18 UTC
according to this data:

https://github.com/openresty/lua-nginx-module/issues/1984


how to add -lpcre in current ebuild?
Comment 4 Gabriel Linder 2022-02-18 13:56:22 UTC
Same here :

$ ebuild nginx-1.21.6.ebuild clean install 
[...]
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: objs/addon/src/ngx_http_lua_pcrefix.o: in function `ngx_http_lua_pcre_malloc_done':
ngx_http_lua_pcrefix.c:(.text+0xfa): undefined reference to `pcre_malloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: ngx_http_lua_pcrefix.c:(.text+0x108): undefined reference to `pcre_free'
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:382: objs/nginx] Error 1
make: *** [Makefile:10: build] Error 2

This trick works :
$ env EXTRA_ECONF="--with-ld-opt='-lpcre'" ebuild nginx-1.21.6.ebuild clean install 
[...]
>>> Install www-servers/nginx-1.21.6 into /var/tmp/portage/www-servers/nginx-1.21.6/image
make --jobs=8 --quiet DESTDIR=/var/tmp/portage/www-servers/nginx-1.21.6/image install 
>>> Completed installing www-servers/nginx-1.21.6 into /var/tmp/portage/www-servers/nginx-1.21.6/image

 * Final size of build directory: 22264 KiB (21.7 MiB)
 * Final size of installed tree:   3472 KiB ( 3.3 MiB)
Comment 5 Kobboi 2022-02-26 16:16:30 UTC
Same here
Comment 6 Marcin Deranek 2022-03-07 13:23:07 UTC
Added sample patch (see linked MR) to address this.
Comment 7 Simon Alman 2022-04-05 12:48:20 UTC
Had to drop naxsi from my module list as that requires pcre2, once that was done the example above worked for me:

env EXTRA_ECONF="--with-ld-opt='-lpcre'" ebuild nginx-1.21.6-r1.ebuild clean install

Thanks.
Comment 8 Tomáš Mózes 2022-07-14 08:53:15 UTC
The lua module only works with pcre, while nginx 1.21.5 switched to building with pcre2 by default.

Ebuild for 1.23.0 now has a pcre2 USE flag that needs to be disabled for the lua module.