From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 943E8158042 for ; Thu, 24 Oct 2024 14:36:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE80CE0969; Thu, 24 Oct 2024 14:36:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A1207E0969 for ; Thu, 24 Oct 2024 14:36:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D8E0933FD3F for ; Thu, 24 Oct 2024 14:36:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3F376AE7 for ; Thu, 24 Oct 2024 14:36:45 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1729780574.e9cc5b98df6ccbfc116cd7340f1aa63e56a233cb.mjo@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/glpk/, sci-mathematics/glpk/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-mathematics/glpk/files/glpk-5.0-aliasing.patch sci-mathematics/glpk/glpk-5.0-r2.ebuild sci-mathematics/glpk/glpk-5.0-r3.ebuild X-VCS-Directories: sci-mathematics/glpk/files/ sci-mathematics/glpk/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: e9cc5b98df6ccbfc116cd7340f1aa63e56a233cb X-VCS-Branch: master Date: Thu, 24 Oct 2024 14:36:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bb7be90f-5f3e-4867-a121-87e7a97fb49d X-Archives-Hash: 3303cc190a85bc9e7bdc72224b07d433 commit: e9cc5b98df6ccbfc116cd7340f1aa63e56a233cb Author: Michael Orlitzky gentoo org> AuthorDate: Mon Oct 21 17:04:12 2024 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Thu Oct 24 14:36:14 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9cc5b98 sci-mathematics/glpk: steal strict-aliasing patch from Fedora This lets us bring LTO back without having to be responsible for a custom patch. Bug: https://bugs.gentoo.org/863047 Signed-off-by: Michael Orlitzky gentoo.org> sci-mathematics/glpk/files/glpk-5.0-aliasing.patch | 89 ++++++++++++++++++++++ .../{glpk-5.0-r2.ebuild => glpk-5.0-r3.ebuild} | 10 +-- 2 files changed, 90 insertions(+), 9 deletions(-) diff --git a/sci-mathematics/glpk/files/glpk-5.0-aliasing.patch b/sci-mathematics/glpk/files/glpk-5.0-aliasing.patch new file mode 100644 index 000000000000..91ca8b189bb6 --- /dev/null +++ b/sci-mathematics/glpk/files/glpk-5.0-aliasing.patch @@ -0,0 +1,89 @@ +Stolen from Fedora: + + https://src.fedoraproject.org/rpms/glpk/raw/rawhide/f/glpk-4.65-alias.patch + +diff -urN glpk-4.65.orig/src/minisat/minisat.c glpk-4.65/src/minisat/minisat.c +--- glpk-4.65.orig/src/minisat/minisat.c 2018-02-16 00:00:00.000000000 -0700 ++++ glpk-4.65/src/minisat/minisat.c 2018-05-20 18:54:25.106624859 -0600 +@@ -135,11 +135,11 @@ struct clause_t + + #define clause_learnt(c) ((c)->size_learnt & 1) + +-#define clause_activity(c) \ +- (*((float*)&(c)->lits[(c)->size_learnt>>1])) ++#define clause_activity(c, a) \ ++ memcpy(&(a), &(c)->lits[(c)->size_learnt>>1], sizeof(float)) + + #define clause_setactivity(c, a) \ +- (void)(*((float*)&(c)->lits[(c)->size_learnt>>1]) = (a)) ++ memcpy(&(c)->lits[(c)->size_learnt>>1], &(a), sizeof(float)) + + /*====================================================================*/ + /* Encode literals in clause pointers: */ +@@ -313,14 +313,18 @@ static inline void act_clause_rescale(so + clause** cs = (clause**)vecp_begin(&s->learnts); + int i; + for (i = 0; i < vecp_size(&s->learnts); i++){ +- float a = clause_activity(cs[i]); +- clause_setactivity(cs[i], a * (float)1e-20); ++ float a; ++ clause_activity(cs[i], a); ++ a *= (float)1e-20; ++ clause_setactivity(cs[i], a); + } + s->cla_inc *= (float)1e-20; + } + + static inline void act_clause_bump(solver* s, clause *c) { +- float a = clause_activity(c) + s->cla_inc; ++ float a; ++ clause_activity(c, a); ++ a += s->cla_inc; + clause_setactivity(c,a); + if (a > 1e20) act_clause_rescale(s); + } +@@ -356,7 +360,7 @@ static clause* clause_new(solver* s, lit + c->lits[i] = begin[i]; + + if (learnt) +- *((float*)&c->lits[size]) = 0.0; ++ memset(&c->lits[size], 0, sizeof(float)); + + assert(begin[0] >= 0); + assert(begin[0] < s->size*2); +@@ -850,10 +854,17 @@ clause* solver_propagate(solver* s) + } + + static inline int clause_cmp (const void* x, const void* y) { +- return clause_size((clause*)x) > 2 +- && (clause_size((clause*)y) == 2 +- || clause_activity((clause*)x) +- < clause_activity((clause*)y)) ? -1 : 1; } ++ clause *cx = (clause *)x; ++ clause *cy = (clause *)y; ++ float fx, fy; ++ if (clause_size(cx) <= 2) ++ return 1; ++ if (clause_size(cy) == 2) ++ return -1; ++ clause_activity(cx, fx); ++ clause_activity(cy, fy); ++ return fx < fy ? -1 : 1; ++} + + void solver_reducedb(solver* s) + { +@@ -874,10 +885,12 @@ void solver_reducedb(solver* s) + learnts[j++] = learnts[i]; + } + for (; i < vecp_size(&s->learnts); i++){ ++ float f; ++ clause_activity(learnts[i], f); + if (clause_size(learnts[i]) > 2 + && reasons[lit_var(*clause_begin(learnts[i]))] + != learnts[i] +- && clause_activity(learnts[i]) < extra_lim) ++ && f < extra_lim) + clause_remove(s,learnts[i]); + else + learnts[j++] = learnts[i]; diff --git a/sci-mathematics/glpk/glpk-5.0-r2.ebuild b/sci-mathematics/glpk/glpk-5.0-r3.ebuild similarity index 90% rename from sci-mathematics/glpk/glpk-5.0-r2.ebuild rename to sci-mathematics/glpk/glpk-5.0-r3.ebuild index ec74e25882a4..477d3016240a 100644 --- a/sci-mathematics/glpk/glpk-5.0-r2.ebuild +++ b/sci-mathematics/glpk/glpk-5.0-r3.ebuild @@ -36,6 +36,7 @@ RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/${PN}-4.65-fix-mysql-include-prefix.patch "${FILESDIR}"/${PN}-4.65-debundle-system-libs.patch + "${FILESDIR}"/${PN}-5.0-aliasing.patch ) src_prepare() { @@ -53,15 +54,6 @@ src_prepare() { } src_configure() { - # -Werror=strict-aliasing - # https://bugs.gentoo.org/863047 - # https://lists.gnu.org/archive/html/bug-glpk/2022-08/msg00000.html - # No upstream response... - # - # Do not trust it to LTO either. - append-flags -fno-strict-aliasing - filter-lto - local myconf if use mysql || use odbc; then myconf="--enable-dl"