public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Jeff Dike <jdike@addtoit.com>,
	Anton Altaparmakov <aia21@cam.ac.uk>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [uml-devel] Re: Partial fix! - Was: Re: [BUG report] UML linux-2.6 latest BK doesn't compile
Date: Sun, 13 Mar 2005 21:06:34 +0100	[thread overview]
Message-ID: <200503132106.35599.blaisorblade@yahoo.it> (raw)
In-Reply-To: <200503080010.j280ABbc005264@ccure.user-mode-linux.org>

Ok, I think I finally solved this problem.

A note for Jeff: I forgot to send this email and complained to you because you 
didn't answer... Sorry Jeff.

However, I explained what I say here to him in chat and we agreed on the fix.

I'm sending this anyway... and I'm attaching the correct fix we discussed.

On Tuesday 08 March 2005 01:10, Jeff Dike wrote:
> blaisorblade@yahoo.it said:
> > a) wrong because you say __GNUC_PATCHLEVEL__ > 4 rather than >=

> Correct, this is now fixed.

> > b) wrong because for he the link failed on __bb_init_func at the
> > beginning. So  in the case you need to export BOTH symbols.

> Incorrect, the link failure was caused by trying to export __bb_init_func,
> which makes a reference to it, which was subsequently not being resolved.
No, the link failure was when linking the first object together in the final 
file.

The symbol was referred to by the wrappers inserted by GCC for gprof / 
gcov, not by the symbol exporting.

Quoting Anton:
> Yes.  I finally found a way to get it to compile.  Compiling without TT
> mode and WITHOUT static build it still fails with the same problem
> (__bb_init_func problem I already reported).  But compiling without TT
> but WITH static build the __bb_init_func problem goes away but instead I
> get a __gcov_init missing symbol in my modules.

And it was fixed when linking statically, as you see (because the symbol is 
not defined in dynamic libraries - don't know if this is a bug of glibc, I 
hope not).

What was needed was the addition of another EXPORT_SYMBOL, but it couldn't be 
added for everybody because it causes the build to fail for old compilers 
which don't export the symbol.

And "old compilers" include normal gcc 3.3.4 (I verified this on my Gentoo 
system).

Also, maybe adding a dependency on static linking for GCOV is needed, maybe.

After some successful testing (maybe I didn't test all cases), however, 
something strange happened: the build started failing because now GCC 
requires the GCOV options (-fprofile-arcs -ftest-coverage) even during 
linking (because the gcov helper functions are now in a separate library). I 
said "strange" because the same build succeeded with gcc 3.3.4, and I didn't 
understand the difference at first.

This required two changes:
- excluding the profiling options from the mk_* utilities.
- adding the GCOV options to linking (this is even documented now). I've 
retested that this wasn't needed with gcc 3.3.4 (and I guess older ones).

Finally, I got an unresolved symbol on __bb_fork_func, and I wasn't able to 
solve this (is it maybe a bug in libc or whatever? I don't know).
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade



  reply	other threads:[~2005-03-14 18:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08 10:09 [BUG report] UML linux-2.6 latest BK doesn't compile Anton Altaparmakov
2005-02-08 10:22 ` Blaisorblade
2005-02-08 10:40   ` Anton Altaparmakov
2005-02-08 17:48     ` [uml-devel] " Blaisorblade
2005-02-08 22:21       ` Jeff Dike
2005-02-08 18:29 ` Jeff Dike
2005-02-08 17:37   ` Blaisorblade
2005-02-08 22:22     ` Jeff Dike
2005-02-14 11:35       ` Partial fix! - Was: " Anton Altaparmakov
2005-02-16 18:27         ` [uml-devel] " Blaisorblade
2005-03-05 19:45         ` Jeff Dike
2005-03-05 18:31           ` Adrian Bunk
2005-03-07 19:44           ` [uml-devel] " Blaisorblade
2005-03-08  0:10             ` Jeff Dike
2005-03-13 20:06               ` Blaisorblade [this message]
     [not found]                 ` <EBD0B8CF381E8B44BB99E8EA137E27C0021AD010@CPEXBE-EML06.kpnsp.local>
2006-09-09  9:31                   ` Blaisorblade
2006-09-11 15:27                     ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503132106.35599.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=aia21@cam.ac.uk \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox