Bug 210237 - www/nginx: Build fails at config check phase, does not find installed PCRE
Summary: www/nginx: Build fails at config check phase, does not find installed PCRE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: Sergey A. Osokin
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2016-06-12 16:33 UTC by Gergely Imreh
Modified: 2016-09-08 08:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (osa)


Attachments
log of "make install" (4.78 KB, text/x-log)
2016-06-12 16:33 UTC, Gergely Imreh
no flags Details
installed packages (13.34 KB, text/x-log)
2016-06-12 16:34 UTC, Gergely Imreh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gergely Imreh 2016-06-12 16:33:50 UTC
Created attachment 171340 [details]
log of "make install"

Trying to compile the latest version of nginx. devel/pcre is installed and the config script finds the shared library, but then configuration fails with PCRE library not being found.
Comment 1 Gergely Imreh 2016-06-12 16:34:21 UTC
Created attachment 171342 [details]
installed packages
Comment 2 VK freebsd_triage 2016-06-12 17:48:17 UTC
Thanks for the report. Now this is interesting, I reported this very problem against porttools in Bug #210021 because in my case it occurred only when running "port test", and not with "make install", and it happened with some other ports and other dependencies.
Comment 3 VK freebsd_triage 2016-06-12 17:49:49 UTC
To clarify, in my case pcre would not automatically install when running "port test" for nginx. Installing it manually fixed the issue, unlike in this PR.
Comment 4 Sergey A. Osokin freebsd_committer freebsd_triage 2016-06-14 21:54:00 UTC
Hi Gergely,

thanks for report!

It looks like nginx' configure script can't compile pcre test on ARM platform.
Could you try to compile next test for me on your ARM machine?

Here is the source code:
% cat pcre-test.c
#include <pcre.h>

int main(int argc, char* argv[]) {
  pcre *re;
  re = pcre_compile(NULL, 0, NULL, 0, NULL);
  if (re == NULL) return 1;
}

Here is the command for compile the source code:

% cc -o pcre-test -I/usr/local/include -L/usr/local/lib -lpcre pcre-test.c
Comment 5 Sergey A. Osokin freebsd_committer freebsd_triage 2016-06-14 22:14:30 UTC
Hi Gergely,

thanks for report!

It looks like nginx' configure script can't compile pcre test on ARM platform.
Could you try to compile next test for me on your ARM machine,

Here is the source code:
% cat pcre-test.c
#include <pcre.h>

int main(int argc, char* argv[]) {
  pcre *re;
  re = pcre_compile(NULL, 0, NULL, 0, NULL);
  if (re == NULL) return 1;
}

Here is the command for compile the source code:

% cc -o pcre-test -I/usr/local/include -L/usr/local/lib -lpcre pcre-test.c
Comment 6 Gergely Imreh 2016-06-15 02:50:09 UTC
(In reply to Sergey A. Osokin from comment #5)

I get:

% cc -o pcre-test -I/usr/local/include -L/usr/local/lib -lpcre pcre-test.c
/usr/bin/ld: ERROR: /usr/local/lib/libpcre.so uses VFP register arguments, pcre-test does not
/usr/bin/ld: failed to merge target specific data of file /usr/local/lib/libpcre.so
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 7 Gergely Imreh 2016-06-15 02:51:43 UTC
Running it with the verbose flag:

% cc -v -o pcre-test -I/usr/local/include -L/usr/local/lib -lpcre pcre-test.c
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/cc" -cc1 -triple armv6kz--freebsd11.0-gnueabi -emit-obj -mrelax-all -disable-free -main-file-name pcre-test.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu arm1176jzf-s -target-feature +soft-float -target-feature +soft-float-abi -target-feature -neon -target-feature -crypto -target-feature +strict-align -target-abi aapcs-linux -msoft-float -mfloat-abi soft -v -dwarf-column-info -debugger-tuning=gdb -resource-dir /usr/bin/../lib/clang/3.8.0 -I /usr/local/include -fdebug-compilation-dir /tmp/pcre-test -ferror-limit 19 -fmessage-length 126 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/pcre-test-fdcd43.o -x c pcre-test.c
clang -cc1 version 3.8.0 based upon LLVM 3.8.0 default target armv6--freebsd11.0-gnueabi
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/3.8.0/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o pcre-test /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/local/lib -L/usr/lib -lpcre /tmp/pcre-test-fdcd43.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
/usr/bin/ld: ERROR: /usr/local/lib/libpcre.so uses VFP register arguments, pcre-test does not
/usr/bin/ld: failed to merge target specific data of file /usr/local/lib/libpcre.so
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2016-06-15 08:27:53 UTC
(In reply to Gergely Imreh from comment #6)
The armv6 port now defaults to hard float ABI since 20160517. Your toolchain still uses the softfp abi: armv6--freebsd11.0-gnueabi (should be gnueabihf), this is the root cause of the error (libpcre.so uses VFP register arguments, pcre-test does not)

Please update your system/toolchain/packages to use the hardfloat abi and report back if you still have the problem.
Comment 9 Gergely Imreh 2016-06-16 03:59:40 UTC
(In reply to mikael.urankar from comment #8)

I see, that makes sense that that might be the issue.

When you say update the system/toolchain/packages to use the hardfloat abi, does it mean a buildworld, or something else? I checked freebsd-update and that doesn't work (doesn't find mirrors for 11.0). Or was there any announcement of this change with some more info? That would be very helpful, my RPi is a headless server that I have limited access too, that's why I'm asking many questions, errors during the upgrade are more troublesome.

In the wiki I still see hardfloat as experimental, and that's why I was surprised that normal package update procedures start mixing things without any sign that things  are going wrong.
Comment 10 Sergey A. Osokin freebsd_committer freebsd_triage 2016-06-16 12:13:19 UTC
(In reply to Gergely Imreh from comment #9)
Gergely,

FreeBSD 11.0 hasn't been released yet, it's under development, the API and ABI for FreeBSD 11 series have been fixed recently.

There two options for upgrade legacy 11.0-CURRENT in this case:

1. binary upgrade - download latest 11.0-SNAPSHOT, boot and upgrade
2. make world - update src, do a make buildworld, buildkernel, ... ), please refer to /usr/src/UPDATING for details.

I'm going to close this PR, thanks for report!