From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id C79CF3857811 for ; Wed, 26 May 2021 01:48:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C79CF3857811 Received: by mail-io1-xd2f.google.com with SMTP id z24so33733520ioi.3 for ; Tue, 25 May 2021 18:48:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=IRJlDqaVoGccg+NgvIvdpR6PrsUsflPO596f/wkEYFs=; b=sZc5Jasfp/YeJ4QwYjWYTTPZXIqZx0iO+yTFfgxcgFz93Ub12FsKE0NZd/4PuMOiH4 RDl9CkijtJOaYxIX+dXz/mR6z2gDmpMpbyKjl4xzcLAtsOFR/lTteqPmlnL6rSbjWxMD DEJnSJ4pRQV1cst12FGU/j2+fWFY0snyloqAo/GpEpYvebMMJq3DEIu75LQpUR/ROx/3 OjGMGKXyAYtQEUHttiu8DgKvhOo0QQvSx/hQ/5VtKB/90gu4x4iSHE8z2qIgg7noUpf5 w9XSsLqodNmgXNOC/ONgP6n+pKIxMfgRHEIouKRDzjDZkBxPrbFK6N6PwOnG6v+r6+Bc 1K/w== X-Gm-Message-State: AOAM532AYbQZW7/NMtxTXvWgmI3bOy4gpzyuvUc9Z9zjjnDetJRB033r 8wFClzkvixCrgwhsiSRmNDlhxPXRz5oMZ56g5sGu/dm3oP0= X-Google-Smtp-Source: ABdhPJzxWVXIiMmKKRBYyyo8vOuZXJ9ay3HcLq1DgEhF4Pu3EWIoIn7tdNjGKCBBRMqmZv0iR1l8B34XnILpB4V1dr8= X-Received: by 2002:a02:cc8d:: with SMTP id s13mr554764jap.17.1621993738342; Tue, 25 May 2021 18:48:58 -0700 (PDT) MIME-Version: 1.0 References: <025a01d75121$117aa560$346ff020$@etri.re.kr> <87y2c31d08.fsf@oldenburg.str.redhat.com> <027f01d7515f$e65ee280$b31ca780$@etri.re.kr> <029401d751cc$c9692b50$5c3b81f0$@etri.re.kr> In-Reply-To: <029401d751cc$c9692b50$5c3b81f0$@etri.re.kr> Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Tue, 25 May 2021 21:48:44 -0400 Message-ID: Subject: Re: undefined reference to symbol 'dlsym@@GLIBC_2.2.5' during qemu build To: ckim@etri.re.kr Cc: libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 01:49:02 -0000 On Tue, May 25, 2021 at 9:29 PM Chan Kim via Libc-help wrote: > > Hi, Florian > > Yes,as you said, the '-ldl' option was being ignored I guess. > I copied the last link command and in it, moved the -ldl option to the end. > When I separately run this modified last command, the final target > qemu-system-aarch64 is built without error message. > Now I have to figure out how to make '-Wl,as-needed' as not default or > automatically place the -ld option to the last in qemu-5.1.0 build system. > (And the debugger(ddd with gdb inside) prompt is a wait pointer. I can see > prints when the program runs)) > Anyway thanks a lot for the help. 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: $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -ldl Jeff