From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by sourceware.org (Postfix) with ESMTPS id D5EC83858D38 for ; Tue, 21 Mar 2023 11:30:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D5EC83858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb35.google.com with SMTP id e194so16640099ybf.1 for ; Tue, 21 Mar 2023 04:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679398249; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WqI+wEVYvrY2dHLf7yey0+19ghFrD2m96siDy7D+3Y4=; b=Ra4Sfse7CMKzpS9AJTUsDnmdJdFM8+XUIwGBu28WsRK2cUL/aqdX7rMeu+DLDH386Z dlNsGUOfTxkNZWEUuAbytE9s5fqFafIxHRqCh2dLxTHP+D4BJ66QVgtk8ABl6oUlChtR gZZrY0HtaIWXo/c4XUuynt+uAD1Y1B4+crABSg/5xFcpMT8AxI32u9Txqz6PItH2jRm9 YO0oNuU8QZJixXOGqVn7ZXhqsx+X4was5wIwoifN8rOKi30nSohtuao9EyQxGIb9+Q+V e+qHKE5fjjeUfZ3GLzLR2qXyuVD25BIhtl93FKDeLWSVO+ZH848biACD7KiDUtc8Woxx tSNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679398249; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WqI+wEVYvrY2dHLf7yey0+19ghFrD2m96siDy7D+3Y4=; b=1WD/nmPoX4B/IzyY/MHcs5vYJPIQHELEwFgu8JjaAkjo/IGCTN4lSSkN0+kIen/S61 h6H2fUnMJYFeoLbqQHRHVGfPU890dIKHmL7CFQf8GdDlQvKl3godPLk9JuzlrsKMAY0j RUpaDJ9AwynwgEVwk1C1QGRXULtNcaV3vxgXnwHUUfA5h4D4C1j1bM6pFCJ/74jJHSKH xtUuWJbRUaQfEKz0ux746e0MuiaEjeFynFeXCXPwjuEXznaM2Y0Go8URyHoecgSwvK5w c0zeDcjeAYyKAhrzfFhRN6uCqDP6ErrBdfO0OhfFom/7/RF6lWhxzR/ov4ehX8g0R65u GZNg== X-Gm-Message-State: AAQBX9fLHdWKvJthY4pP8V1iwSKJMrqP1+H+on5hk2TJjvIctYkv+nuw 5MXhphue1Drl7HhUDBKwVC1iGkEZ08qCyleQCok= X-Google-Smtp-Source: AKy350aHV5xnEPwhme90rz2AQD9NrjeCnXG3DlZP7S12sUOcTxSTvuDZLmzaJSi6kCMpsoPawLr6rBlo9NKZ6Pjfm9k= X-Received: by 2002:a05:6902:708:b0:b6c:2224:8a77 with SMTP id k8-20020a056902070800b00b6c22248a77mr1300069ybt.1.1679398249072; Tue, 21 Mar 2023 04:30:49 -0700 (PDT) MIME-Version: 1.0 References: <6c8e0fc6-9e86-6fc7-433f-cf5df16a6b03@linaro.org> <87jzzi14fx.fsf@oldenburg.str.redhat.com> <7d1b9611-13d1-65f0-9b47-0f7d01cec66c@linaro.org> <6dbfce9e-31c8-f158-f13d-4f91ca40efd8@linaro.org> In-Reply-To: <6dbfce9e-31c8-f158-f13d-4f91ca40efd8@linaro.org> From: Abhijit Ray Chaudhury Date: Tue, 21 Mar 2023 17:00:35 +0530 Message-ID: Subject: Re: compiling glibc using -fasynchronous-unwind-tables for arm To: Adhemerval Zanella Netto Cc: Florian Weimer , Adhemerval Zanella Netto via Libc-help Content-Type: multipart/alternative; boundary="000000000000128d1905f76760d8" X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000128d1905f76760d8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Adhemerval, In my build environment gcc toolchain is installed in docker through apt. I will try to find the source code and build . Can you please let me know why you are concentrating on the resolution of " __aeabi_unwind_cpp_pr0" symbol ? I thought if you give "-fasynchronous- unwind-tables -fno-unwind-tables", gcc should not even generate the " __aeabi_unwind_cpp_pr0" symbol. My toolchain wrongly generates it . Is my understanding correct? Kindly advise, -Abhijit On Mon, Mar 20, 2023 at 10:30=E2=80=AFPM Adhemerval Zanella Netto < adhemerval.zanella@linaro.org> wrote: > The -fasynchronous-unwind-table usually is used so backtraces works > through signal handlers. > Could you check if you build your toolchain with optimization flags (so > libgcc is built with > -O2) you can also build with -fasynchronous-unwind-table? > > On 17/03/23 10:37, Abhijit Ray Chaudhury wrote: > > Hello Adhemerval, > > > > I could compile glibc with -funwind-table instead of > -fasynchronous-unwind-table. I noticed glibc uses one of the flags for > different files. As far as stack unwinding is concerned , what is the > difference between -fasynchronous-unwind-table and -funwind-table ? > > > > Thanking You, > > -Abhijit > > > > On Thu, Mar 16, 2023 at 4:29=E2=80=AFPM Abhijit Ray Chaudhury < > abhijit.ray.chaudhury@gmail.com > > wrote: > > > > Hi, > > > > I think the problem lies with the precedence of seemingly > conflicting CFLAGS "-fasynchronous-unwind-tables -fno-unwind-tables" > supplied to my cross toolchain gcc. I compiled a simple C file with " > -fasynchronous-unwind-tables" , it generated an undefined symbol " > `__aeabi_unwind_cpp_pr0'" although compilation was successful without > -static flag. Then I compiled with " -fasynchronous-unwind-tables > -fno-unwind-tables", it still generated the undefined symbol " > `__aeabi_unwind_cpp_pr0'". It suggests " -fno-unwind-tables" does not stop > unwind information in the ELF when I have " -fasynchronous-unwind-tables"= . > I then compiled with " -funwind-tables -fno-unwind-table", I did not find > undefined symbol " `__aeabi_unwind_cpp_pr0'"in the generated ELF. > > > > So I will compile glibc with " -funwind-table" instead of " > -fasynchronous-unwind-table" and let you know the result. > > > > Do you see any problem with this approach ? > > > > Thanking You, > > -Abhijit > > > > On Thu, Mar 16, 2023 at 1:22=E2=80=AFAM Adhemerval Zanella Netto < > adhemerval.zanella@linaro.org > > wrote: > > > > > > > > On 15/03/23 11:20, Florian Weimer wrote: > > > * Adhemerval Zanella Netto via Libc-help: > > > > > >> And I have tested with both: > > >> > > >> CC=3D"arm-glibc-linux-gnueabihf-gcc > -fasynchronous-unwind-tables" > > >> > > >> and > > >> > > >> CC=3Darm-glibc-linux-gnueabihf-gcc CFLAGS=3D"-O2 > -fasynchronous-unwind-tables" > > >> > > >> I also tested with gcc from ubuntu22 to check if this might > something > > >> I haven't enabled on my toolchain (since I don't build all > languages), > > >> but again I did not see any issue. > > > > > > It probably depends on whether libgcc.a has been built with > > > optimizations or not. > > > > Indeed this looks like > https://sourceware.org/bugzilla/show_bug.cgi?id=3D29621 < > https://sourceware.org/bugzilla/show_bug.cgi?id=3D29621> . > > Does the build work if you manually adds the > -fasynchronous-unwind-tables > > on config.make? > > > --000000000000128d1905f76760d8--