NetBSD Problem Report #57977

From www@netbsd.org  Fri Mar  1 21:29:10 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CB33D1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  1 Mar 2024 21:29:09 +0000 (UTC)
Message-Id: <20240301212908.3DA551A923A@mollari.NetBSD.org>
Date: Fri,  1 Mar 2024 21:29:08 +0000 (UTC)
From: schaecsn@gmx.net
Reply-To: schaecsn@gmx.net
To: gnats-bugs@NetBSD.org
Subject: Mozilla products don't compiled with -march=native
X-Send-Pr-Version: www-1.0

>Number:         57977
>Category:       pkg
>Synopsis:       Mozilla products don't compiled with -march=native
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 01 21:30:00 +0000 2024
>Originator:     Stefan Schaeckeler
>Release:        pkgsrc-2023Q4
>Organization:
>Environment:
NetBSD XXX 10.0_RC4 NetBSD 10.0_RC4 (GENERIC) #0: Sun Feb 18 08:20:49 PST 2024  root@dell.wonderland.de:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
Mozilla products don't compiled with -march=native

I have -march=native in my CFLAGS in /etc/mk.conf. Mozilla products don't compile now.

mail/thunderbird:

/usr/include/gcc-10/avx2intrin.h: In function '__m256i mozilla::CmpEq256(__m256i, __m256i) [with TValue = unsigned char]':
/usr/include/gcc-10/avx2intrin.h:231:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_cmpeq_epi8(__m256i, __m256i)': target specific option mismatch
  231 | _mm256_cmpeq_epi8 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~~
/var/tmp/pkgsrc/mail/thunderbird/work/thunderbird-115.5.1/mozglue/misc/SIMD_avx2.cpp:52:29: note: called from here
   52 |     return _mm256_cmpeq_epi8(a, b);
      |            



www/firefox115:

/usr/include/gcc-10/avx2intrin.h:231:1: error: inlining failed in call to 'always_inline' '__m256i _mm256_cmpeq_epi8(__m256i, __m256i)': target specific option mismatch
  231 | _mm256_cmpeq_epi8 (__m256i __A, __m256i __B)
      | ^~~~~~~~~~~~~~~~~
/var/tmp/pkgsrc/www/firefox115/work/firefox-115.5.0/mozglue/misc/SIMD_avx2.cpp:52:29: note: called from here
   52 |     return _mm256_cmpeq_epi8(a, b);
      |            ~~~~~~~~~~~~~~~~~^~~~~~

>How-To-Repeat:
Add -march=native to CFLAGS in /etc/mk.conf and build firefox115 or thunderbird.

I've seen this issue on now older firefox and thunderbird pkgsrc versions over the last couple of years as well.
>Fix:
The most straight-foward way is probably to remove -march=native from BUILDLINK_TRANSFORM:


Index: mail/thunderbird/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/thunderbird/Makefile,v
retrieving revision 1.307
diff -u -p -r1.307 Makefile
--- mail/thunderbird/Makefile   4 Dec 2023 03:46:03 -0000       1.307
+++ mail/thunderbird/Makefile   1 Mar 2024 21:22:21 -0000
@@ -38,6 +38,9 @@ NOT_PAX_MPROTECT_SAFE+=       lib/${MOZILLA_NA

 LDFLAGS+=              ${COMPILER_RPATH_FLAG}${PREFIX}/lib/${MOZILLA_NAME}

+# Avoid failure inlining _mm256_cmpeq_epi8()
+BUILDLINK_TRANSFORM+=          rm:-march=native
+
 # Workaround for https://bugs.llvm.org/show_bug.cgi?id=46366
 BUILDLINK_TRANSFORM.NetBSD+=   rm:-fexperimental-new-pass-manager

Index: www/firefox115/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/firefox115/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- www/firefox115/Makefile     22 Dec 2023 17:11:31 -0000      1.10
+++ www/firefox115/Makefile     1 Mar 2024 21:23:49 -0000
@@ -79,6 +79,9 @@ BUILDLINK_TRANSFORM.SunOS+=   rm:-fdata-se
 BUILDLINK_TRANSFORM.SunOS+=    rm:-ffunction-sections
 BUILDLINK_TRANSFORM.SunOS+=    rm:-pie

+# Avoid failure inlining _mm256_cmpeq_epi8()
+BUILDLINK_TRANSFORM+=          rm:-march=native
+
 # Workaround for https://bugs.llvm.org/show_bug.cgi?id=46366
 BUILDLINK_TRANSFORM.NetBSD+=   rm:-fexperimental-new-pass-manager

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.