Bug 61417 - apr-util MUST NOT use buildflags of installed apr
Summary: apr-util MUST NOT use buildflags of installed apr
Status: RESOLVED WONTFIX
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.6.0
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-15 11:46 UTC by Reindl Harald
Modified: 2018-04-17 13:25 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reindl Harald 2017-08-15 11:46:06 UTC
_____________________________________________

checking for APR... yes
  setting CPP to "gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -E"
_____________________________________________

while wondring why my rpmbuild ½optflags extended with "-march=native -mtune=native" for optimized builds in some outputs just ignore the flags it looks like apr-util at buildtime sets them above to the same as used for building apr

this is plain wrong and dangerous when all your spec files like below are supposed to build native tuned binaries as well as -mtune=sandybridge because when you have on the buildmachine -mtune=native apr installed your apr-util also get built with -mtune=native which is NOT the intention when build without "--with production"

please stop mangle around with build flags unasked
_____________________________________________

# command 'rpmbuild -bb apr-util.spec --with production' will tune for current hardware while default stays 'sandybridge'

%if %{?_with_production:1}%{!?_with_production:0}
 %global rpmsuffix native
 %global build_native_release 1
 %global optflags %{optflags} -march=native -mtune=native
%else
 %global rpmsuffix sandybridge
 %global build_native_release 0
%endif
Comment 1 Reindl Harald 2017-08-15 11:51:10 UTC
voila - the apr package on the buildmachine is built with -mtune=native, the apr-util build was started WITHOUT that flag and that happens - this apr-util package would NOT run on the target machine

checking for APR... yes
  setting CPP to "gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -E"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
Comment 2 Nick Kew 2017-08-15 20:13:39 UTC
I don't understand what you're trying to do and what doesn't work.  Are you saying apr-util build is ignoring a --with-apr and using an installed version?
Comment 3 Reindl Harald 2017-08-15 20:19:49 UTC
it should use the installed version but NOT read out the buildflags from that binary - NOBODY did specify "-march=native -mtune=native" for this build, but "apr" itself was built with that flags and httpd has the same behavior (https://bz.apache.org/bugzilla/show_bug.cgi?id=61418)



[builduser@testserver:/rpmbuild/SPECS]$ rpmbuild -bb apr-util.spec 
Ausführung(%prep): /bin/sh -e /var/tmp/rpm-tmp.sSbgQz
+ umask 022
+ cd /home/builduser/rpmbuild/BUILD
+ cd /home/builduser/rpmbuild/BUILD
+ rm -rf apr-util-1.6.0
+ /usr/bin/bzip2 -dc /home/builduser/rpmbuild/SOURCES/apr-util-1.6.0.tar.bz2
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd apr-util-1.6.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #1 (apr-util-1.2.7-pkgconf.patch):'
Patch #1 (apr-util-1.2.7-pkgconf.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p1 -b --suffix .pkgconf --fuzz=0
patching file Makefile.in
Hunk #1 succeeded at 73 (offset 22 lines).
patching file apu-config.in
+ echo 'Patch #2 (apr-util-1.4.1-private.patch):'
Patch #2 (apr-util-1.4.1-private.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p1 -b --suffix .private --fuzz=0
patching file apr-util.pc.in
+ exit 0
Ausführung(%build): /bin/sh -e /var/tmp/rpm-tmp.UQzHa7
+ umask 022
+ cd /home/builduser/rpmbuild/BUILD
+ cd apr-util-1.6.0
+ autoheader
+ autoconf
+ export 'CFLAGS=-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ CFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ export 'CXXFLAGS=-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'                                                                                 
+ CXXFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'                                                                                        
+ export 'CC=gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'                                                                                   
+ CC='gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'                                                                                          
+ export 'SH_LDFLAGS=-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ SH_LDFLAGS='-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ export 'LDFLAGS=-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -pie -fPIE'
+ LDFLAGS='-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -pie -fPIE'
+ CFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ export CFLAGS
+ CXXFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin'
+ export CXXFLAGS
+ FFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -pie -fPIE'
+ export LDFLAGS
+ ./configure --host=x86_64-redhat-linux --build=x86_64-redhat-linux --target=x86_64-redhat-linux --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-apr=/usr --includedir=/usr/include/apr-1 --enable-nonportable-atomics --without-ldap --disable-ldap --without-gdbm --without-sqlite3 --without-pgsql --with-mysql --without-odbc --without-freetds --without-berkeley-db --without-sqlite2 --with-crypto --with-openssl --with-nss
configure: WARNING: unrecognized options: --disable-dependency-tracking, --enable-nonportable-atomics, --disable-ldap, --without-freetds
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.0
checking for chosen layout... apr-util
checking for x86_64-redhat-linux-gcc... gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin accepts -g... yes
checking for gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-redhat-linux-gnu
checking for APR... yes
  setting CPP to "gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -E"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
checking how to run the C preprocessor... gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking openssl/x509.h usability... yes
checking openssl/x509.h presence... yes
checking for openssl/x509.h... yes
checking for EVP_CIPHER_CTX_new in -lcrypto... yes
checking for SSL_accept in -lssl... yes
  setting LDADD_crypto_openssl to " -lssl -lcrypto"
checking for const input buffers in OpenSSL... yes
checking for x86_64-redhat-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
  adding "-I/usr/include/nss3" to CPPFLAGS
  adding "-I/usr/include/nspr4" to CPPFLAGS
  adding "-lssl3" to LDFLAGS
  adding "-lsmime3" to LDFLAGS
  adding "-lnss3" to LDFLAGS
  adding "-lnssutil3" to LDFLAGS
  adding "-lplds4" to LDFLAGS
  adding "-lplc4" to LDFLAGS
  adding "-lnspr4" to LDFLAGS
  adding "-lpthread" to LDFLAGS
  adding "-ldl" to LDFLAGS
checking prerror.h usability... yes
checking prerror.h presence... yes
checking for prerror.h... yes
checking nss/nss.h usability... no
checking nss/nss.h presence... no
checking for nss/nss.h... no
checking nss.h usability... yes
checking nss.h presence... yes
checking for nss.h... yes
checking nss/pk11pub.h usability... no
checking nss/pk11pub.h presence... no
checking for nss/pk11pub.h... no
checking pk11pub.h usability... yes
checking pk11pub.h presence... yes
checking for pk11pub.h... yes
checking for PR_Initialize in -lnspr4... yes
checking for PK11_CreatePBEV2AlgorithmID in -lnss3... yes
  adding "-I/usr/include/nss3" to APRUTIL_PRIV_INCLUDES
  adding "-I/usr/include/nspr4" to APRUTIL_PRIV_INCLUDES
  setting LDADD_crypto_nss to "-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lnspr4 -lnss3"
checking for ldap support...
checking for default DBM... sdbm (default)
checking for mysql_config... /usr/bin/mysql_config
  adding "-I/usr/include/mysql" to CPPFLAGS
  setting LIBS to "-L/usr/lib64/mysql  -lmariadb -lz -lpthread -ldl -lm -lssl -lcrypto"
checking for mysql.h... yes
checking for mysql_init in -lmysqlclient... yes
checking for my_global.h... yes
checking for mysql_init in -lmysqlclient... (cached) yes
checking for my_sys.h... yes
checking for mysql_init in -lmysqlclient... (cached) yes
  adding "-I/usr/include/mysql" to APRUTIL_PRIV_INCLUDES
  setting LDADD_dbd_mysql to "-L/usr/lib64/mysql         -lmysqlclient -L/usr/lib64/mysql  -lmariadb -lz -lpthread -ldl -lm -lssl -lcrypto"
checking Expat 1.95.x... yes
  setting APRUTIL_EXPORT_LIBS to "-lexpat"
  setting APRUTIL_LIBS to "-lexpat"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
checking whether the compiler handles weak symbols... yes
checking for memset_s support... no
checking for explicit_bzero support... no
  adding "/usr/lib64/libapr-1.la" to APRUTIL_LIBS
  adding "-lpthread" to APRUTIL_LIBS
  adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands
configure: WARNING: unrecognized options: --disable-dependency-tracking, --enable-nonportable-atomics, --disable-ldap, --without-freetds
+ make -j8
make[1]: Entering directory '/home/builduser/rpmbuild/BUILD/apr-util-1.6.0'
gawk -f /usr/lib64/apr-1/build/make_exports.awk /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_anylock.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_base64.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_buckets.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_crypto.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_date.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_dbd.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_dbm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_hooks.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_init.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_option.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_rebind.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_url.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_md4.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_md5.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_memcache.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_optional.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_optional_hooks.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_queue.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_redis.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_reslist.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_rmm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_sdbm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_sha1.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_siphash.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_strmatch.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_thread_pool.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_uri.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_uuid.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_xlate.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_xml.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apu_errno.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apu_version.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_crypto_internal.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbd_internal.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbd_odbc_v2.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbm_private.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apu_internal.h > exports.c
gawk -f /usr/lib64/apr-1/build/make_var_export.awk /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_anylock.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_base64.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_buckets.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_crypto.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_date.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_dbd.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_dbm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_hooks.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_init.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_option.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_rebind.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_ldap_url.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_md4.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_md5.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_memcache.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_optional.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_optional_hooks.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_queue.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_redis.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_reslist.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_rmm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_sdbm.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_sha1.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_siphash.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_strmatch.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_thread_pool.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_uri.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_uuid.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_xlate.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apr_xml.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apu_errno.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/apu_version.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_crypto_internal.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbd_internal.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbd_odbc_v2.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apr_dbm_private.h /home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private/apu_internal.h > export_vars.c
sed 's,^\(location=\).*$,\1installed,;s,^\(APR_.*_DIR\)=.*,\1="${libdir}/build",' < apu-1-config > apu-config.out
/bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin   -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native -O3 -fno-strict-aliasing -fno-gcse-after-reload -fno-inline-functions -fno-ipa-cp -fno-ipa-cp-clone -fno-peel-loops -fno-predictive-commoning -fno-tree-loop-distribute-patterns -fno-unswitch-loops -fPIC -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include -I/home/builduser/rpmbuild/BUILD/apr-util-1.6.0/include/private -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/mysql  -I/usr/include/apr-1    -o crypto/apr_crypto_openssl.lo -c crypto/apr_crypto_openssl.c && touch crypto/apr_crypto_openssl.lo
Comment 4 Reindl Harald 2017-08-15 20:31:27 UTC
to make it clear: in the previous comment you see cleary the CFLAGS only with "-march=sandybridge -mtune=sandybridge" but because "apr" was built with "-march=native -mtune=native" now you build unasked apr-util/httpd also with "native"

that behavior makes it hard to impossible maintain apr/apr-util/httpd with build for the production cluster as well as older machines (move the resulting rpm-packages to the correct repo is easy by the arch-suffix in the release-tag) because if you have installed the native "apr" package "apr-util" and "httpd" inherit the buildflages from the installed apr/apr-devel at build time

/bin/sh /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -m64 -O2 -g0 -mfpmath=sse -mavx -msse2avx -march=sandybridge -mtune=sandybridge -fopenmp -pipe -fno-strict-aliasing -fomit-frame-pointer -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -march=native -mtune=native
Comment 5 Eric Covener 2017-10-29 14:45:59 UTC
(In reply to Reindl Harald from comment #4)

> that behavior makes it hard to impossible maintain apr/apr-util/httpd with
> build for the production cluster as well as older machines (move the
> resulting rpm-packages to the correct repo is easy by the arch-suffix in the
> release-tag) because if you have installed the native "apr" package
> "apr-util" and "httpd" inherit the buildflages from the installed
> apr/apr-devel at build time

earlier: 

> --with-apr=/usr

Why would you use the installed APR to build apr-util but not expect them to be compiled the same? More cross-compile like patches are welcome, but you'll have to keep these bug reports civil and concise if you want people to keep reading them.
Comment 6 Reindl Harald 2017-10-29 14:55:47 UTC
because with the current chain apr-util inherit from apr und httpd interhit from apr/apr-util i can not build a simple -mtune=sandybridge binary without first replace the bianry -mtune=native apr package

the same for https://bz.apache.org/bugzilla/show_bug.cgi?id=61418
this has nothing to do with cross-compilation at all

until there is a update for apr itself by just link against the binary you can build apr-util for -mtnue=native and -mtune=sandybridge and place the resulting rpm packages in different repos

in the current shape you need to build first apr with the desired -mtune, install the devel-package, build apr-util the same way, install it and then you can build httpd - terrible - for s simle httpd update which you want to build for prudoction severs as well as older developmetn machines you can't just fire up rpmbuild twice because you need take care about apr/apr-util all the time

__________________________________


"Working as designed. If you want more control, build httpd w/ an included apr as the manual already describes" - than that is broken by design 

<sarcasm>why do we have CCFLAGS/LDFLAGS at all when we can in herit from glibc or the lowest package in the chain we find</sarcasm>
Comment 7 Reindl Harald 2017-10-29 14:56:30 UTC
because with the current chain apr-util inherit from apr und httpd interhit from apr/apr-util i can not build a simple -mtune=sandybridge binary without first replace the bianry -mtune=native apr package

the same for https://bz.apache.org/bugzilla/show_bug.cgi?id=61418
this has nothing to do with cross-compilation at all

until there is a update for apr itself by just link against the binary you can build apr-util for -mtnue=native and -mtune=sandybridge and place the resulting rpm packages in different repos

in the current shape you need to build first apr with the desired -mtune, install the devel-package, build apr-util the same way, install it and then you can build httpd - terrible - for s simle httpd update which you want to build for prudoction severs as well as older developmetn machines you can't just fire up rpmbuild twice because you need take care about apr/apr-util all the time

__________________________________


"Working as designed. If you want more control, build httpd w/ an included apr as the manual already describes" - than that is broken by design 

<sarcasm>why do we have CCFLAGS/LDFLAGS at all when we can in herit from glibc or the lowest package in the chain we find</sarcasm>
Comment 8 Reindl Harald 2017-10-29 15:13:32 UTC
maybe the script below makes it more understandable, it build all that packages with -mtune=native and these are always installed on the buildmachine

i want to build httpd for older machines without replace apr/apr-util every time and i have seen no other case where GCC flags are inhertied from whatever library especially when CFLAGS and LDFLAGS are explicit set

[builduser@testserver:/rpmbuild/SPECS]$ cat build-native.sh
#!/usr/bin/bash

akt_user=`whoami`
if test $akt_user == "root"
then
 echo "NOT AS ROOT"
 exit 1
fi

cd /rpmbuild/SPECS/

basearch=`uname -i`
releasever=`rpm -q --qf "%{version}\n" generic-release`

function rh_update_built_packages
{
 sudo yum-deprecated --nogpgcheck -y update /rpmbuild/RPMS/$basearch/*.rpm
 sudo yum-deprecated --nogpgcheck -y update /rpmbuild/RPMS/noarch/*.rpm
}

> /rpmbuild/build-native.log

rpmbuild -bb apr.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rh_update_built_packages
rpmbuild -bb apr-util.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rh_update_built_packages
rpmbuild -bb httpd.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rh_update_built_packages
rpmbuild -bb mariadb.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rpmbuild -bb mod_security.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rpmbuild -bb php.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rpmbuild -bb php-pecl*.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rpmbuild -bb trafficserver.spec --with production 2>&1 | tee -a /rpmbuild/build-native.log
rh_update_built_packages
Comment 9 Reindl Harald 2018-04-16 15:09:28 UTC
bundle apr/apr-util with httpd don't work because other than modules or bundeled stuff in case of PHP they are own files which would collide with the system packages (there is other software which would use them)

taken from "If prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR unpack them into "srclib/apr" and "srclib/apr-util" and be sure the directory names do not have  version numbers"

%global apr_version 1.6.3
%global apr_util_version 1.6.1

# prepare build with '--with-included-apr' to fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61417 for native builds
tar xfj /rpmbuild/SOURCES/apr-%{apr_version}.tar.bz2
mv apr-%{apr_version} ./srclib/apr
tar xfj /rpmbuild/SOURCES/apr-util-%{apr_util_version}.tar.bz2
mv apr-util-%{apr_util_version} ./srclib/apr-util


build httpd with "--with-included-apr" ends with the follwoing messages which clearly shows that these files are not builtin like "--enable-mods-static"

error: Installed (but unpackaged) file(s) found:
   /usr/lib64/httpd/build/apr_common.m4
   /usr/lib64/httpd/build/find_apr.m4
   /usr/lib64/httpd/build/libtool
   /usr/lib64/httpd/build/make_exports.awk
   /usr/lib64/httpd/build/make_var_export.awk
   /usr/lib64/libapr-1.a
   /usr/lib64/libapr-1.la
   /usr/lib64/libapr-1.so
   /usr/lib64/libapr-1.so.0
   /usr/lib64/libapr-1.so.0.6.3
   /usr/lib64/libaprutil-1.a
   /usr/lib64/libaprutil-1.la
   /usr/lib64/libaprutil-1.so
   /usr/lib64/libaprutil-1.so.0
   /usr/lib64/libaprutil-1.so.0.6.1
   /usr/lib64/pkgconfig/apr-1.pc
   /usr/lib64/pkgconfig/apr-util-1.pc
Comment 10 Reindl Harald 2018-04-16 16:55:40 UTC
that all because 3 depending projects can't leave the CFALGS of the prevvious built ones in peace as every other library-package does 

if they only would support "--extra-cflags" and "-extra-ldflags" like ffmpeg does and add that at the right end so that you can simply ovverride -march/-mtune and be done


trying to package that stuff below /usr/local/lib64 just don't work because --libdir=/usr/local/lib64 leads in all sort of problems for out-of-tree modules like mod_dav_svn/mod_security linked against system apr

Apr 16 18:19:49 testserver httpd[76888]: httpd: Syntax error on line 10 of /etc/httpd/conf/httpd.conf: Syntax error on line 4 of /etc/httpd/conf/httpd-modules.conf: Syntax error on line 3 of /etc/httpd/modsecurity.d/mod_security.conf: Cannot load /usr/lib64/httpd/modules/mod_security2.so into server: /usr/lib64/httpd/modules/mod_security2.so: undefined symbol: apr_crypto_passphrase
____________________________

[root@testserver:~]$ ldd /usr/sbin/httpd
 linux-vdso.so.1 (0x00007ffdb6fce000)
 libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fa9dcdcb000)
 libz.so.1 => /lib64/libz.so.1 (0x00007fa9dcbb4000)
 libaprutil-1.so.0 => /usr/local/lib64/libaprutil-1.so.0 (0x00007fa9dd14c000)
 libapr-1.so.0 => /usr/local/lib64/libapr-1.so.0 (0x00007fa9dd11b000)

[root@testserver:~]$ ldd /usr/lib64/httpd/modules/mod_security2.so
 linux-vdso.so.1 (0x00007fff98ff1000)
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3698e7b000)
 libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f3698c49000)
 libapr-1.so.0 => /lib64/libapr-1.so.0 (0x00007f36991ae000)
 libaprutil-1.so.0 => /lib64/libaprutil-1.so.0 (0x00007f3699186000)
____________________________

try to rebuild mod_security as long as apr-devel/apr-util-devel are installed parallel to the new httpd-devel package fails

-I/usr/include/apr-1 -c acmp.c -o mod_security2_la-acmp.o >/dev/null 2>&1
In file included from re.h:42:0,
 from msc_util.h:29,
 from modsecurity.h:40,
 from msc_crypt.h:18,
 from msc_crypt.c:15:
apache2.h:18:10: fatal error: http_core.h: No such file or directory
 #include "http_core.h"
 ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:836: mod_security2_la-msc_crypt.lo] Error 1
In file included from re.h:42:0,
 from msc_util.h:29,
 from modsecurity.h:40,
 from msc_pcre.h:33,
 from msc_status_engine.h:22,
 from msc_status_engine.c:15:
apache2.h:18:10: fatal error: http_core.h: No such file or directory
 #include "http_core.h"
____________________________

rebukld mod_security without them fails too because "/usr/bin/apxs" has wrong paths the files are below /usr/local/lib64/httpd/build

cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
cannot open /usr/lib64/httpd/build/config_vars.mk: No such file or directory at /usr/bin/apxs line 203.
checking for libpcre config script... /usr/bin/pcre-config
configure: using pcre v8.42
checking for libapr config script... no
configure: *** apr library not found.
configure: error: apr library is required
error: Bad exit status from /var/tmp/rpm-tmp.Eh5Etr (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Eh5Etr (%build)
[builduser@testserver:/rpmbuild/SPECS]$ cat /usr/bin/apxs | grep config_vars.mk
get_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
Comment 11 Reindl Harald 2018-04-16 20:51:39 UTC
well, a new build provdiding apr/apr-util sub-packages requires all out-of-tree modules to get re-compiled (--with-included-apr)

so problem with mod_security
but "mod_dav_svn-1.9.7-1.fc27.x86_64" from Fedora don't load

frankly the "merged" httpd build has included all fedora patches but still don't produce the same binary as build apr/apr-util seperated from httpd

[root@srv-rhsoft:~]$ apachectl -t
httpd: Syntax error on line 34 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf/httpd-base-live.conf: Cannot load modules/mod_dav_svn.so into server: /lib64/libsvn_subr-1.so.0: undefined symbol: apr_crypto_block_cleanup
_______________________


%define            apr_version      1.6.3
%define            apr_util_version 1.6.1
%define            aprver           1
%define            apuver           1

%define            contentdir       %{_datadir}/httpd
%define            docroot          %{_var}/www
%define            mmn              20120211
%define            mmnisa           %{mmn}%{__isa_name}%{__isa_bits}
%define            vstring          thelounge.net

# Drop automatic provides for module DSOs
%{?filter_setup:
%filter_provides_in %{_libdir}/httpd/modules/.*\.so$
%filter_setup
}

%if %{?_with_production:1}%{!?_with_production:0}
 %global rh_mavx %{mavx_native}
 %global rpmsuffix native
 %global build_native_release 1
 %global optflags $(sed "s/sandybridge/native/g" <<< "%{optflags}")
%else
 %global rh_mavx avx
 %global rpmsuffix sandybridge
 %global build_native_release 0
%endif

Summary:           Apache HTTP Server
Name:              httpd
Version:           2.4.33
Release:           20.%{build_native_release}%{?dist}.%{rpmsuffix}
URL:               https://www.apache.org/dist/httpd/
Source0:           %{name}/%{name}-%{version}.tar.bz2
Source1:           %{name}.sysconf
Source2:           %{name}.tmpfiles
Source3:           %{name}.service
Source10:          apr-%{apr_version}.tar.bz2
Source11:          apr-util-%{apr_util_version}.tar.bz2
Patch1:            %{name}-2.4.1-apctl.patch
Patch2:            %{name}-2.4.3-layout.patch
Patch3:            %{name}-2.4-no-server-header.patch
Patch4:            %{name}-factor-out-logic-to-determine-if-request-is-using-ssl-tls.patch
Patch10:           %{name}-apr-1.2.2-locktimeout.patch
Patch11:           %{name}-apr-1.2.2-libdir.patch
Patch12:           %{name}-apr-1.2.7-pkgconf.patch
Patch20:           %{name}-apr-util-1.2.7-pkgconf.patch
Patch21:           %{name}-apr-util-1.4.1-private.patch
License:           ASL 2.0
BuildRequires:     autoconf
BuildRequires:     findutils
BuildRequires:     openssl-devel
BuildRequires:     pcre-devel
BuildRequires:     /usr/bin/perl
BuildRequires:     pkgconfig
BuildRequires:     xmlto
BuildRequires:     zlib-devel
Requires:          %{_sysconfdir}/mime.types
Obsoletes:         %{name}-suexec
Provides:          webserver
Provides:          %{name}-mmn = %{mmn}
Provides:          %{name}-mmn = %{mmnisa}
Requires(pre):     %{_sbindir}/useradd

# lounge hacks to get rid of mod_perl (perl-Net-DRI works without)
Obsoletes:         mod_perl
Provides:          perl(APR::Table)
Provides:          perl(Apache2::Const)
Provides:          perl(Apache2::Log)
Provides:          perl(Apache2::RequestIO)
Provides:          perl(Apache2::RequestRec)
Provides:          perl(Apache2::RequestUtil)

%description
The Apache HTTP Server is a powerful and extensible web server

%package -n        apr
Summary:           Apache Portable Runtime library
%description -n    apr

%package -n        apr-util
Summary:           Apache Portable Runtime Utility Library
%description -n    apr-util

%package           devel
Summary:           Development interfaces for the Apache HTTP server
Requires:          pkgconfig
Requires:          %{name} = %{version}-%{release}
Provides:          apr-devel
Provides:          apr-util-devel
Obsoletes:         apr-devel
Obsoletes:         apr-util-devel
%description       devel

%package           manual
Summary:           Documentation for the Apache HTTP server
Requires:          %{name} = %{version}-%{release}
BuildArch:         noarch
%description       manual

%package           tools
Summary:           Tools for use with the Apache HTTP Server
%description       tools

%package -n        mod_cgi
Summary:           mod_cgi for the Apache HTTP Server
Provides:          mod_cgi = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_cgi

%package -n        mod_dav
Summary:           mod_dav for the Apache HTTP Server
Provides:          mod_dav = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_dav

%package -n        mod_info
Summary:           mod_info for the Apache HTTP Server
Provides:          mod_info = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_info

%package -n        mod_proxy
Summary:           mod_proxy for the Apache HTTP Server
Provides:          mod_proxy = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_proxy

%package -n        mod_proxy_http
Summary:           mod_proxy_http for the Apache HTTP Server
Provides:          mod_proxy_http = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
Requires:          mod_proxy = %{version}-%{release}
%description -n    mod_proxy_http

%package -n        mod_status
Summary:           mod_status for the Apache HTTP Server
Provides:          mod_status = %{version}-%{release}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_status

%package -n        mod_ssl
Summary:           TLS module for the Apache HTTP Server
Epoch:             1
Requires(pre):     %{name}
Requires:          %{name} = %{version}-%{release}
%description -n    mod_ssl

%prep
# unpack httpd tarball
%setup -q

# apply httpd-patches
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p0

# prepare build for '--with-included-apr' to fix https://bz.apache.org/bugzilla/show_bug.cgi?id=61417 for native builds
tar xfj /rpmbuild/SOURCES/apr-%{apr_version}.tar.bz2
mv apr-%{apr_version} ./srclib/apr
tar xfj /rpmbuild/SOURCES/apr-util-%{apr_util_version}.tar.bz2
mv apr-util-%{apr_util_version} ./srclib/apr-util

# apply apr-patches
%patch10 -p1
%patch11 -p1
%patch12 -p1

# apply apr-util-patches
%patch20 -p1
%patch21 -p1

# patch in the vendor string
sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
# prevent use of setcap in "install-suexec-caps" target.
sed -i '/suexec/s,setcap ,echo Skipping setcap for ,' Makefile.in
# safety check: prevent build if defined MMN does not equal upstream MMN.
vmmn=`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include include/ap_mmn.h | sed -n '/^2/p'`
if test "x${vmmn}" != "x%{mmn}"; then
 : Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}
 : Update the mmn macro and rebuild.
 exit 1
fi

%build
# forcibly prevent use of bundled pcre
rm -rf srclib/pcre

# regenerate configure scripts
libtoolize --force --copy --quiet
autoheader && autoconf || exit 1

# before configure; fix location of build dir in generated apxs
%{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/%{name}/build:g" support/apxs.in

# optimized compiler flags
export CFLAGS="%{optflags} %{OS_flags} -m%{rh_mavx} -D_GLIBCXX_ASSERTIONS -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -Wa,--noexecstack"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS"
export CC="gcc $CFLAGS"
export SH_LDFLAGS="-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Wl,-z,nodump %{optflags} %{OS_flags} -m%{rh_mavx} -D_GLIBCXX_ASSERTIONS -flto -ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin -Wa,--noexecstack"
export LDFLAGS="$SH_LDFLAGS -pie -fPIE"
export GLIBC_TUNABLES="glibc.elision.enable=1"

# Hard-code path to links to avoid unnecessary builddep
export LYNX_PATH=%{_bindir}/links

# Build the daemon
./configure \
 --prefix=%{_sysconfdir}/%{name} \
 --exec-prefix=%{_prefix} \
 --bindir=%{_bindir} \
 --sbindir=%{_sbindir} \
 --mandir=%{_mandir} \
 --libdir=%{_libdir} \
 --sysconfdir=%{_sysconfdir}/%{name}/conf \
 --includedir=%{_includedir}/%{name} \
 --libexecdir=%{_libdir}/%{name}/modules \
 --datadir=%{contentdir} \
 --enable-allocator-uses-mmap \
 --enable-layout=Fedora \
 --enable-modules=none \
 --enable-mods-shared="cgi dav info proxy proxy_http ssl status" \
 --enable-mods-static="alias allowmethods auth_basic auth_digest authn_core authn_file authz_core authz_groupfile authz_host authz_user autoindex deflate dir env expires filter headers log_config mime ratelimit remoteip reqtimeout rewrite setenvif socache_shmcb unique_id unixd version" \
 --enable-mpms-static=prefork \
 --enable-nonportable-atomics \
 --enable-pie \
 --with-included-apr \
 --with-installbuilddir=%{_libdir}/%{name}/build \
 --with-mpm=prefork \
 --with-pcre \
 --with-pic \
 --with-ssl \
 --disable-dav_fs \
 --disable-debug \
 --disable-lbmethod_bybusyness \
 --disable-lbmethod_byrequests \
 --disable-lbmethod_bytraffic \
 --disable-lbmethod_heartbeat \
 --disable-ldap \
 --disable-proxy_ajp \
 --disable-proxy_balancer \
 --disable-proxy_connect \
 --disable-proxy_express \
 --disable-proxy_fcgi \
 --disable-proxy_fdpass \
 --disable-proxy_ftp \
 --disable-proxy_scgi \
 --disable-proxy_uwsgi \
 --disable-proxy_wstunnel \
 --disable-static
Comment 12 Reindl Harald 2018-04-16 23:57:16 UTC
when you have httpd+mod_security+mod_dav_svn+mod_php it's not that easy

anyways, at https://access.thelounge.net/harry/httpd-apr.tar.bz2 you find a tarball with a spec-file+src.rpm+unpacked tarball based on Fedora builds with modiefied apr/apr-util pactehs and support for 'rpmbuild -bb httpd.spec --with production' to get a native build for VMware clusters in EVC mode while at the same time you can build sandybrdige-optimized packages without stupid inherit of mtune/march from the seperate apr/apr-util packages

* php build works
* mod_security build works
* out-of-tree Fedora mod_dav_svn is happy too
* the builds by intention don't contain config files and so on - it's for production

that said to "you don't do much by yourself either" of https://bz.apache.org/bugzilla/show_bug.cgi?id=61519#c34

you all don't have the slightest idea what i do all "by myself" without bother anybody - that was around 8 hours of work because of plain stupid inherance of CFLAGS
Comment 13 Reindl Harald 2018-04-17 00:31:18 UTC
and to make it clear where the problem and hwat the goal was:

* build httpd/apr/apr-util with -march=native/mtune=mative
* don't inherit -mtune=native in a httpd-update
  which is not targeted that way just because apr/apr-util
  are installed in a vesion with that flags
* don't spit stuff in /usr/local
* don't break ditstribution packaged out-of-tree modules
* don't break php-build becaus eof idiotoic "libtool" copy left and
  right while this is a SYSTEM-PACKAGE but your apr-stuff
  spits out code where a php build break because of the apxs
  crap 

[builduser@testserver:~]$ rpm -q --file /usr/bin/libtool
libtool-2.4.6-20.fc27.x86_64

# prevent php build-errors (/usr/lib64/httpd/build/instdso.sh: line 63: /usr/lib64/apr-1/build/libtool: No such file or directory)
mkdir -p %{buildroot}%{_libdir}/apr-%{aprver}/build/
ln -s %{_libdir}/httpd/build/libtool  %{buildroot}%{_libdir}/apr-%{aprver}/build/libtool

simliar crap in the php.spec because it insists to modify a httpd.conf with the mod_php module line which is not requststed nor useful within a rmbuild and so on
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf

[builduser@testserver:~]$ rpm -qa | grep "2\.4\.33" | sort
apr-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
apr-util-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
httpd-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
httpd-devel-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
httpd-tools-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
mod_cgi-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
mod_proxy-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
mod_proxy_http-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
mod_ssl-2.4.33-28.0.fc27.20180417.rh.sandybridge.x86_64
Comment 14 Eric Covener 2018-04-17 12:52:45 UTC
For what I can sort out from comment#1, These two packages are being combined in a future release, so this kind of change is not really something on the table.

For the subsequent comments: get a blog. Or better yet, don't.
Comment 15 Reindl Harald 2018-04-17 13:25:38 UTC
exactly the same happens when you build httpd, the CFLAGS from apr are inherited and there is no reason to do so - if other software would deal the same way nobody would be able to compile anything with -mtune=whatever because the -mtune=generic from the distribution and how glibc was built would override it

CFLAGS are *user flags* and there is no valid reason just because the installed apr/apr-util was built with -mtune=native to do the same with httpd when i cleary say export CFLAGS="-march=sandybridge -mtune=snadybridge"