Hi Willy,
Op 19-11-2017 om 22:54 schreef Willy Tarreau:
On Sun, Nov 19, 2017 at 10:43:21PM +0100, Willy Tarreau wrote:
Your workaround has disabled locking so you'll get random bugs if you enable
threads. Could you please send the output of "cc -v" ? That should help
figure how this situation is possible. In the mean time you can build with
"USE_THREAD=" to disable threads.
OK I found what happens. For an unknown reason you have no optimization
settings, and apparently by default Clang doesn't even perform constant
optimizations (ie: when you write "if (0) do_something()" it still wants
to emit the code for "do_something()". So the check on the argument size
still works but the compiler is unhappy with the error message used to
stop the build.
Does your build command line force the CPU variable or the CPU_CFLAGS
variable ? I suspect it's this. By not forcing it, you'll stay on
"generic" and it will use "-O2" by default, avoiding this problem.
We still need to improve this (possibly by detecting clang and lack of
optimization if needed), otherwise the questionn will come back from
time to time.
Thanks,
Willy
Sorry, I should have mentioned how i was trying to build haproxy, didn't
even think of my build options would matter here..
Was using this: make clean build reinstall NO_CHECKSUM=yes
WITH_DEBUG=yes STRIP=
So it would have debug symbols if problems would arise..
The "WITH_DEBUG=yes" strips the -O2 away and makes it a -g and thus
'changing' the way the compiler works.
Without this flags it indeed builds without issue. But any future gdb
session wouldn't have symbols..
Thanks,
PiBa-NL / Pieter
p.s.
Not sure if it still matters but for the record my cc -v output:
root@:/usr/ports/net/haproxy-devel # cc -v
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on
LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin