From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44688 invoked by alias); 18 Dec 2018 06:42:23 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 44674 invoked by uid 89); 18 Dec 2018 06:42:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 06:42:21 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B46DB13821F; Tue, 18 Dec 2018 06:42:19 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-85.ams2.redhat.com [10.36.116.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E71B05D6A6; Tue, 18 Dec 2018 06:42:18 +0000 (UTC) From: Florian Weimer To: Yubin Ruan Cc: gcc-help@gcc.gnu.org Subject: Re: which object file is fstat64/stat64 located References: <871s6gcrsy.fsf@oldenburg2.str.redhat.com> Date: Tue, 18 Dec 2018 08:57:00 -0000 In-Reply-To: (Yubin Ruan's message of "Tue, 18 Dec 2018 10:32:55 +0800") Message-ID: <87k1k749pz.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00059.txt.bz2 * Yubin Ruan: > On Mon, Dec 17, 2018 at 7:32 PM Florian Weimer wrote: >> >> * Yubin Ruan: >> >> > I am seeking help here since I got error of "undefined reference to >> > fstat64/stat64" when linking without libstdc++ in a C++ program. I was >> > trying to use libcxx, so I added -nodefaultlibs when compiling the >> > program. To get necessary symbols from libc, I added -lc (and also >> > -lm -lgcc_s -lgcc). But I still got the undefined reference error. >> >> What's your target? > > My target is a C++ program(mysqld) which use fstat/stat and other C++ > standard library functions. Normally libstdc++ is used and everything > is fine. But I want to switch to libcxx. With target I meant something like Windows, MacOS, or GNU/Linux, and the processor architecture. But for libcxx support, you should ask on a libcxx mailing list, not on a GNU mailing list. Thanks, Florian