diff --git a/gn-0153d369-no-O3.patch b/gn-0153d369-no-O3.patch new file mode 100644 index 0000000..13a4820 --- /dev/null +++ b/gn-0153d369-no-O3.patch @@ -0,0 +1,14 @@ +diff -Naur gn-0153d369bbccc908f4da4993b1ba82728055926a-original/build/gen.py gn-0153d369bbccc908f4da4993b1ba82728055926a/build/gen.py +--- gn-0153d369bbccc908f4da4993b1ba82728055926a-original/build/gen.py 2021-09-27 14:58:14.000000000 -0400 ++++ gn-0153d369bbccc908f4da4993b1ba82728055926a/build/gen.py 2021-09-27 15:59:42.330405195 -0400 +@@ -344,10 +344,8 @@ + cflags.extend(['-O0', '-g']) + else: + cflags.append('-DNDEBUG') +- cflags.append('-O3') + if options.no_strip: + cflags.append('-g') +- ldflags.append('-O3') + # Use -fdata-sections and -ffunction-sections to place each function + # or data item into its own section so --gc-sections can eliminate any + # unused functions and data items. diff --git a/gn.spec b/gn.spec index af64ca3..41999d9 100644 --- a/gn.spec +++ b/gn.spec @@ -45,6 +45,8 @@ Source2: update-version # Clean up compiler warnings on gcc/g++: Patch0: https://src.fedoraproject.org/rpms/chromium/raw/ce30313f5e4af121140c037bf026453355534f24/f/chromium-84.0.4147.105-gn-gcc-cleanup.patch +# Stop overriding optimization flags +Patch1: %{name}-0153d369-no-O3.patch # The python3_pkgversion macro is required for EPEL; see # https://fedoraproject.org/wiki/PackagingDrafts:Python3EPEL. On Fedora (and @@ -84,7 +86,9 @@ The %{name}-doc package contains detailed documentation for GN. %prep -%autosetup -c -n %{name}-%{commit} -p3 +%setup -c -n %{name}-%{commit} -q +%patch0 -p3 +%patch1 -p1 # Use pre-generated last_commit_position.h. mkdir -p ./out @@ -96,8 +100,6 @@ cp -vp misc/vim/README.md README-vim.md # Fix shebangs in examples and such. %py3_shebang_fix . -# On EPEL7, we would have to work around the missing py3_shebang_fix macro, but -# the package would not build anyway because it requires C++17 support. %build