Skip to content

Commit

Permalink
sync GCC11 changes to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Nov 24, 2022
1 parent 0b4ad91 commit 525a066
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 85 deletions.
41 changes: 41 additions & 0 deletions gcc-03af8492bee6243a9d10e78fea1a3e423bd5f9cd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 03af8492bee6243a9d10e78fea1a3e423bd5f9cd Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <[email protected]>
Date: Fri, 27 May 2022 12:43:18 +0100
Subject: [PATCH] libstdc++: Mark non-exported function always_inline
[PR105671]

This new function was added for gcc 11.1 but is not exported from the
shared library. Depending on inlining decisions, its callers might get
inlined but an external definition be needed for this function. That
then fails to link.

Since we can't add the export to the gcc-11 release branch now, mark it
always_inline. We can consider exporting it for gcc-13 if/when we bump
the shared library version (and maybe also for gcc-12 which is currently
at the same version as trunk). For now, the attribute will solve the
problem on all affected branches. The function is small enough that
force-inlining it shouldn't cause problems.

libstdc++-v3/ChangeLog:

PR libstdc++/105671
* include/std/sstream (basic_stringbuf::_M_high_mark): Add
always_inline attribute.

(cherry picked from commit de57440858591a88e8fd7ba2505ca54546c86021)
---
libstdc++-v3/include/std/sstream | 1 +
1 file changed, 1 insertion(+)

diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index f21664100ab8..56555ecd98a1 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -425,6 +425,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
// This might not be the same character as _M_string.end() because
// basic_stringbuf::overflow might have written to unused capacity
// in _M_string without updating its length.
+ __attribute__((__always_inline__))
char_type*
_M_high_mark() const _GLIBCXX_NOEXCEPT
{
78 changes: 0 additions & 78 deletions gcc-103-substitution-bug-fix.patch

This file was deleted.

8 changes: 4 additions & 4 deletions gcc.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
### RPM external gcc 10.3.0
### RPM external gcc 11.2.1
## USE_COMPILER_VERSION
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64
# Use the git repository for fetching the sources. This gives us more control while developing
# a new platform so that we can compile yet to be released versions of the compiler.
# See: https://gcc.gnu.org/viewcvs/gcc/branches/gcc-8-branch/?view=log
%define gccTag f00b5710a30f22efc3171c393e56aeb335c3cd39
%define gccBranch releases/gcc-10
%define gccTag a0a0499b8bb920fdd98e791804812f001f0b4fe8
%define gccBranch releases/gcc-11

%define moduleName %{n}-%{realversion}
Source0: git+https://github.com/gcc-mirror/%{n}.git?obj=%{gccBranch}/%{gccTag}&export=%{moduleName}&output=/%{n}-%{realversion}-%{gccTag}.tgz
Expand Down Expand Up @@ -38,7 +38,7 @@ Source11: https://github.com/westes/flex/releases/download/v%{flexVersion}/flex-

Patch0: gcc-flex-nonfull-path-m4
Patch1: gcc-flex-disable-doc
Patch2: gcc-103-substitution-bug-fix
Patch2: gcc-03af8492bee6243a9d10e78fea1a3e423bd5f9cd

%prep

Expand Down
5 changes: 2 additions & 3 deletions vecgeom.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cmake ../%{n}-%{realversion} \
-DCMAKE_AR=$(which gcc-ar) \
-DCMAKE_RANLIB=$(which gcc-ranlib) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" \
-DNO_SPECIALIZATION=ON \
-DBACKEND=Scalar \
%ifarch x86_64
Expand All @@ -37,11 +36,11 @@ cmake ../%{n}-%{realversion} \
%endif
-DGEANT4=OFF

make %{makeprocesses}
make %{makeprocesses} VERBOSE=1

%install
cd ../build
make %{makeprocesses} install
make %{makeprocesses} install VERBOSE=1

%post
%{relocateConfig}lib/cmake/VecGeom/*.cmake

0 comments on commit 525a066

Please sign in to comment.