public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dallman, John" <john.dallman@siemens.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: C, -fexceptions, libgcc_s, and related matters on arm64
Date: Fri, 22 Oct 2021 13:24:30 +0000	[thread overview]
Message-ID: <dca9c792953e4028991756086243aad4@siemens.com> (raw)

I work on a commercial mathematical modelling library, built from C code, and delivered on Linux as a .so. It has to be capable of having C++ exceptions thrown through it, as many of the applications that use it are C++.

On x86-64 CentOS 7, with GCC 4.8.3 driven by the LSB 5.0 lsbcc, I compile with -fexceptions, which causes some of my object files to need __gcc_personality_v0 and _Unwind_Resume, I link with -shared-libgcc and -lgcc_s. That satisfies the requirements for __gcc_personality_v0 and _Unwind_Resume, and allows C++ exceptions to be thrown from below me in the call stack, propagate through me, and be caught above me. That's fine.

I'm starting to build for arm64 on Ubuntu 20.04, with GCC 9.3 and no LSB tools involved. I use -fexceptions, but that does not generate any need for __gcc_personality_v0, _Unwind_Resume or any of the other symbols in libgcc_s.so. I'm a bit puzzled about this, and nervous about accepting it as normal. There are no Linux arm64 versions of the applications that use the library yet, so my ability to test C++ exception throwing through the library is limited to trivial programs: all of the test harnesses I have are C.

My x86-64 compile options are: /opt/lsb/bin/lsbcc -m64 -O2 -fno-strict-aliasing -fPIC -D _POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -c -fexceptions -std=c99 -Wformat -Wformat-security

My arm64 compile options are similar: cc -march=armv8-a -ffp-contract=off -O -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112L -c -fexceptions -std=c99 -Wformat -Wformat-security -fstack-protector-strong -fno-strict-aliasing

Any suggestions?

Thanks in advance,

--
John Dallman
Siemens Digital Industries Software


-----------------
Siemens Industry Software Limited is a limited company registered in England and Wales.
Registered number: 3476850.
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.

             reply	other threads:[~2021-10-22 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 13:24 Dallman, John [this message]
2021-10-23 12:38 ` Florian Weimer
2021-10-26 10:03   ` Dallman, John

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=dca9c792953e4028991756086243aad4@siemens.com \
    --to=john.dallman@siemens.com \
    --cc=gcc-help@gcc.gnu.org \
    /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).