public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: <ckim@etri.re.kr>
To: <noloader@gmail.com>
Cc: "'libc-help'" <libc-help@sourceware.org>
Subject: RE: undefined reference to symbol 'dlsym@@GLIBC_2.2.5' during qemu build
Date: Wed, 26 May 2021 13:57:06 +0900	[thread overview]
Message-ID: <02a301d751eb$93c86ff0$bb594fd0$@etri.re.kr> (raw)
In-Reply-To: <CAH8yC8khDrLNNMzUQvYQOXoKU2C0jgt33L=7qEhY8xz+ikEnag@mail.gmail.com>


Hi, Jeffery, and all,

After reading your comment, I briefly looked into the qemu build script (configure script and the generated Makefiles)
And looks like it follows your flag placement rule.
So I figured out how to do it. Now the configure script is this (under build directory):

../configure --target-list=aarch64-softmmu --enable-debug --enable-gtk --extra-ldflags="-Wl,--no-as-needed -ldl"

This makes the link flag placed at the end. Now the undefined reference to symbol 'dlsym@@GLIBC_2.2.5' error is gone, and dlopen, dlsym works ok.
The debugger hang problem was in the ./ddd/init file. 
(I changed "set extended-prompt not set\n\"  to "set extended-prompt (gdb) \n\"  https://stackoverflow.com/questions/2914003/ddd-hangs-on-start)

Now I can do the normal debugging.
Thanks a lot!
Chan Kim

> The make recipe is off a bit.
> 
> Ld is a single pass linker. -ldl needs to be near the end of the list of
> object files and libraries, not the beginning. I.e., it should be
> something like:
> 
> foo: <objs>
>     $(CC) $(CFLAGS) <objs> $(LDFLAGS) $(LDLIBS) -ldl
> 
> Jeff





      reply	other threads:[~2021-05-26  4:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  4:47 ckim
2021-05-25  7:36 ` Florian Weimer
2021-05-25 12:17   ` ckim
2021-05-25 12:21     ` Florian Weimer
2021-05-26  1:16     ` ckim
2021-05-26  1:48       ` Jeffrey Walton
2021-05-26  4:57         ` ckim [this message]

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='02a301d751eb$93c86ff0$bb594fd0$@etri.re.kr' \
    --to=ckim@etri.re.kr \
    --cc=libc-help@sourceware.org \
    --cc=noloader@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).