summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-02-26 17:42:20 +0300
committerValentin Bartenev <vbart@nginx.com>2019-02-26 17:42:20 +0300
commitce6ce15c2042421588cd7f0635744239caf1cb31 (patch)
treeafcdb1230f3af044beee9599806e8b9e292a8d65 /pkg/rpm
parentaa7478267aa53667a29a021ddc0d425cf877b89e (diff)
downloadunit-ce6ce15c2042421588cd7f0635744239caf1cb31.tar.gz
unit-ce6ce15c2042421588cd7f0635744239caf1cb31.tar.bz2
Fixed violation of the strict aliasing rules in 5d0edd35c4ce.
In order to reduce number of operations over rb-tree and process them in batches simultaneously, all the timers changes are temporary stored in array. While processing of these changes, the same memory is also used for storing pointers to postpone timers adding. As the same block of memory has been referenced by two different types of pointers (nxt_timer_change_t * and nxt_timer_t **), some compilers may reorder operations with these pointers and produce broken code. See ticket #221 on GitHub for a particular case. Now the same "nxt_timer_change_t" structure is used in both cases. Also, reverted the -fno-strict-aliasing flag, which has been introduced in ef76227ec159 as a workaround for this issue.
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/unit.module.spec.in4
-rw-r--r--pkg/rpm/unit.spec.in5
2 files changed, 0 insertions, 9 deletions
diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in
index d06db231..8b8a3433 100644
--- a/pkg/rpm/unit.module.spec.in
+++ b/pkg/rpm/unit.module.spec.in
@@ -10,11 +10,7 @@
%define unit_version %%UNIT_VERSION%%
%define unit_release %%UNIT_RELEASE%%%{?dist}.ngx
-%if (0%{?rhel} == 6) && (%{_arch} == x86_64)
-%define CC_OPT %{optflags} -fno-strict-aliasing
-%else
%define CC_OPT %{optflags}
-%endif
%define CONFIGURE_ARGS $(echo "%%CONFIGURE_ARGS%%")
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 2d5c1bd1..05ee79af 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -29,12 +29,7 @@ BuildRequires: openssl-devel
BuildRequires: libopenssl-devel
%endif
-%if (0%{?rhel} == 6) && (%{_arch} == x86_64)
-%define CC_OPT %{optflags} -fno-strict-aliasing -fPIC
-%else
%define CC_OPT %{optflags} -fPIC
-%endif
-
%define LD_OPT -Wl,-z,relro -Wl,-z,now -pie
%define CONFIGURE_ARGS $(echo "%%CONFIGURE_ARGS%%")