[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #18841 [Core Tor/Tor]: Test test_bt.sh fails
#18841: Test test_bt.sh fails
--------------------------+------------------------------------
Reporter: trudokal | Owner:
Type: defect | Status: needs_review
Priority: Medium | Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor | Version: Tor: 0.2.8.2-alpha
Severity: Major | Resolution:
Keywords: test, patch | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
--------------------------+------------------------------------
Changes (by trudokal):
* status: new => needs_review
* keywords: test => test, patch
* severity: Normal => Major
Comment:
(raised severity, because this bug misconfigures tor, see below)
Replying to [comment:4 trudokal]:
> = Possible solution =
> Since the test depend on '-rdynamic' being set and this does not seem to
be
> enabled by all distributions. It should be enabled for the test.
> But instead of enabling for the whole build (a distro might have a good
reason
> for disabling it, I don't know), only enable it in the linking phase of
> test-bt-ct.
>
> I'm not an expert in autotools/make, but getting a '-rdynamic' in the
target
> for test-bt-cl in Makefile.in seems to do it. Sadly, I have no clue how
to get
> it there, because the target is auto-generated by autogen.sh.
Investigated a little further why '-rdynamic' is not defined in
{{{CFLAGS}}}.
config.log states
{{{
[...]
configure:9451: checking whether the linker accepts -rdynamic
configure:9494: x86_64-pc-linux-gnu-gcc -std=gnu99 -o conftest -g -O2
-D_FORTIFY_SOURCE=2 -pedantic -Werror -I${top_srcdir}/src/common
-rdynamic conftest.c -lcap -lpthread -ldl >&5
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
cc1: all warnings being treated as errors
configure:9494: $? = 1
configure: program exited with status 1
configure: failed program was:
[...]
configure:9508: result: no
}}}
Similar for a bunch of other configure checks.
The reason is that Gentoo has some patches which predefine
{{{_FORTIFY_SOURCE}}} yielding warnings of the form
{{{
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>:0:0: note: this is the location of the previous definition
}}}
which in configure yield an error and hence a misconfiguration.
This warning is also printed at every file we compile.
I found a similar issue by an other software:
http://tracker.ceph.com/issues/13920
The solution is simple: undefine {{{_FORTIFY_SOURCE}}} before defining it.
= Patch =
{{{
diff --git a/configure.ac b/configure.ac
index 4bdd2d3..bd50577 100644
--- a/configure.ac
+++ b/configure.ac
@@ -761,7 +761,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
#endif])], have_clang=yes, have_clang=no)
if test "x$enable_gcc_hardening" != "xno"; then
- CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+ CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
if test "x$have_clang" = "xyes"; then
TOR_CHECK_CFLAGS(-Qunused-arguments)
fi
}}}
(patch is also attached)
Patch was tested against current master branch.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18841#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs