Bug 241506

Summary: graphics/mesa needs _GNU_SOURCE in strtod.c
Product: Ports & Packages Reporter: Jesper Schmitz Mouridsen <jsm>
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: Closed FIXED    
Severity: Affects Only Me CC: arrowd, x11, zeising
Priority: --- Flags: zeising: maintainer-feedback+
zeising: merge-quarterly+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 237662    
Attachments:
Description Flags
v1 none

Description Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-10-26 17:56:00 UTC
Follow up on bug #237662 the root cause was in mesa, it reused the actual locale
and not the C locale as intended in mesa-18.3.2/src/util/strtod.c  

if you define _GNU_SOURCE in that file strtof_l gets called as intended, i.e with the C locale loc thus not scrambling numbers as 0.444  with a decimal sep of "," from the users locale...
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2019-10-26 18:03:40 UTC
Wow, nice find! But the bug should be reported upstream, I think?
Comment 2 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-10-26 18:48:46 UTC
(In reply to Gleb Popov from comment #1)
reported upstream as https://gitlab.freedesktop.org/mesa/mesa/issues/2008
Comment 3 Niclas Zeising freebsd_committer freebsd_triage 2019-10-28 09:23:59 UTC
Nice find indeed!
I'll try to create a patch against our current version of mesa for you to test.
Comment 4 Niclas Zeising freebsd_committer freebsd_triage 2019-10-28 16:47:47 UTC
Created attachment 208658 [details]
v1

Hi!
Can you try the attached patch?
Apply it against the ports tree, then rebuild and reinstall mesa-dri and mesa-libs.
Comment 5 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2019-10-29 00:02:25 UTC
(In reply to Niclas Zeising from comment #4)
Yes, the patch works.
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-10-30 19:07:51 UTC
A commit references this bug:

Author: zeising
Date: Wed Oct 30 19:07:33 UTC 2019
New revision: 516100
URL: https://svnweb.freebsd.org/changeset/ports/516100

Log:
  graphics/mesa: Add -D_GNU_SOURCE to compile flags

  Add -D_GNU_SOURCE to compile flags when building on FreeBSD.  This is needed
  to have mesa work with various locales, that for instance use , instead of .
  as a decmal separator.

  Bump portrevision on all mesa related ports.

  PR:		241506
  Reported by:	Jesper Schmitz Mouridsen
  MFH:		2019Q4

Changes:
  head/graphics/libosmesa/Makefile
  head/graphics/libxatracker/Makefile
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/files/patch-configure
  head/graphics/mesa-libs/Makefile
  head/lang/clover/Makefile
Comment 7 Niclas Zeising freebsd_committer freebsd_triage 2019-10-30 19:10:39 UTC
Waiting for MFH approval.
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-10-31 18:59:29 UTC
A commit references this bug:

Author: zeising
Date: Thu Oct 31 18:59:04 UTC 2019
New revision: 516189
URL: https://svnweb.freebsd.org/changeset/ports/516189

Log:
  MFH: r516100

  graphics/mesa: Add -D_GNU_SOURCE to compile flags

  Add -D_GNU_SOURCE to compile flags when building on FreeBSD.  This is needed
  to have mesa work with various locales, that for instance use , instead of .
  as a decmal separator.

  Bump portrevision on all mesa related ports.

  PR:		241506
  Reported by:	Jesper Schmitz Mouridsen

  Approved by:	ports-secteam (joenum)

Changes:
_U  branches/2019Q4/
  branches/2019Q4/graphics/libosmesa/Makefile
  branches/2019Q4/graphics/libxatracker/Makefile
  branches/2019Q4/graphics/mesa-dri/Makefile
  branches/2019Q4/graphics/mesa-dri/files/patch-configure
  branches/2019Q4/graphics/mesa-libs/Makefile
  branches/2019Q4/lang/clover/Makefile
Comment 9 Niclas Zeising freebsd_committer freebsd_triage 2019-10-31 19:05:14 UTC
Merged.
Thanks for the nice catch!