Opened 9 years ago

Closed 9 years ago

#474 closed defect (fixed)

bind10 doesn't compile with clang++ on FreeBSD

Reported by: jinmei Owned by: jreed
Priority: medium Milestone: y2 12 month milestone
Component: build system Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 0.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

That is due to failure in configuring libtool for creating shared objects.

See the problem about "hidden symbol `dso_handle'" at
http://wiki.freebsd.org/PortsAndClang
and/or
http://lists.freebsd.org/pipermail/freebsd-current/2010-October/020323.html

BIND 10 suffers from the same problem.

According to these links FreeBSD worked around this issue by modifying the configure script. We could do the same, but I believe I found a bit better solution (although still an ugly hack).

Could someone review the attached patch? This is probably a topic for Jeremy, and so I'm going to give the ticket to him.

Another note: with this patch merged, we can build and test bind10 with clang++ on freebsd8-32-1-on-virt1. So it would be good idea to incorporate it to the buildbot framework. clang++ can find errors that other compilers cannot, so it will help keep our code cleaner and more portable.

Subtickets

Attachments (1)

configure.ac.diff (1.0 KB) - added by jinmei 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by jinmei

comment:1 follow-up: Changed 9 years ago by jinmei

  • Status changed from new to reviewing

And this is the proposed changelog entry:

  144.?	[build]		jinmei
	Introduced a workaround for clang++ build on FreeBSD (and probably
	some other OSes).  If building BIND 10 fails with clang++ due to
	a link error about "__dso_handle", try again from the configure
	script with CXX_LIBTOOL_LDFLAGS=-L/usr/lib (the path actually
	doesn't matter; the important part is the -L flag).  This
	workaround is not automatically enabled as it's difficult to
	detect the need for it dynamically, and must be enabled via the
	variable by hand.
	Another unrelated note about clang++ on FreeBSD: the build may
	fail in compiling a test.  If that happens try disabling compiler
	optimization by setting CXXFLAGS manually. (Trac #474, svn rTBD)

As noted above, we need to disable compiler optimization to build it on freebsd8-32-1-on-virt1 (e.g., by CXXFLAGS=-g).

The only offending file is ccsession_unittests.cc. I've not figured it why (yet), maybe it's too complicated? In any case if we want to solve it this should go to a separate ticket.

comment:2 in reply to: ↑ 1 Changed 9 years ago by jreed

Replying to jinmei:

And this is the proposed changelog entry:

  144.?	[build]		jinmei
	Introduced a workaround for clang++ build on FreeBSD (and probably
	some other OSes).  If building BIND 10 fails with clang++ due to
	a link error about "__dso_handle", try again from the configure
	script with CXX_LIBTOOL_LDFLAGS=-L/usr/lib (the path actually
	doesn't matter; the important part is the -L flag).  This
	workaround is not automatically enabled as it's difficult to
	detect the need for it dynamically, and must be enabled via the
	variable by hand.

It would be nice if this could be automated. Or maybe there is a newer AC_PROG_LIBTOOL macro that does the right thing. But for now this is fine to commit. I tested it with clang++

Another unrelated note about clang++ on FreeBSD: the build may
fail in compiling a test. If that happens try disabling compiler
optimization by setting CXXFLAGS manually. (Trac #474, svn rTBD)

This part I don't think needs to be in the changelog.

Also the error with that may need a different bug ticket. I hit it but didn't explore. I then did "make CXXFLAGS=-g" and make completed.

The only offending file is ccsession_unittests.cc. I've not figured it why (yet), maybe it's too complicated? In any case if we want to solve it this should go to a separate ticket.

Yes, different ticket.

comment:3 Changed 9 years ago by jinmei

Merged to master. Created a separate ticket for the build error with optimization (#480). Closing ticket.

comment:4 Changed 9 years ago by jinmei

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.