Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 580184

Summary: www-client/firefox-45.0.1 with glibc-2.23: "error: 'major' was not declared in this scope"
Product: Gentoo Linux Reporter: Philipp Middendorf <pmidden+gentoo>
Component: Current packagesAssignee: Mozilla Gentoo Team <mozilla>
Status: RESOLVED OBSOLETE    
Severity: normal CC: anthonyryan1, herrtimson, j.muehlenhoff, jarausch, johannes.hirte, mgorny, slyfox, toralf
Priority: Normal Keywords: InOverlay
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1329798
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 575232    
Attachments: emerge --info firefox
firefox-50.1.0-glibc-2.24.patch
Upstreamable patch

Description Philipp Middendorf 2016-04-16 08:09:41 UTC
Created attachment 430726 [details]
emerge --info firefox

I just ran emerge firefox. The build log outputs:

/var/tmp/portage/www-client/firefox-45.0.1/work/firefox-45.0.1/xpcom/io/nsLocalFileUnix.cpp: In member function 'virtual nsresult nsLocalFile::GetDiskSpaceAvailable(int64_t*)':
/var/tmp/portage/www-client/firefox-45.0.1/work/firefox-45.0.1/xpcom/io/nsLocalFileUnix.cpp:1395:46: error: 'major' was not declared in this scope
   if (!GetDeviceName(major(mCachedStat.st_dev),
/var/tmp/portage/www-client/firefox-45.0.1/work/firefox-45.0.1/xpcom/io/nsLocalFileUnix.cpp:1396:46: error: 'minor' was not declared in this scope
                      minor(mCachedStat.st_dev),
                                              ^
/var/tmp/portage/www-client/firefox-45.0.1/work/firefox-45.0.1/config/rules.mk:956: recipe for target 'nsLocalFileUnix.o' failed


See attached my emerge --info.
Comment 1 Philipp Middendorf 2016-04-16 08:18:05 UTC
On closer examination, it seems that "major" und "minor" are defined in sys/sysmacros.h (although the manpage says it's in sys/types.h) which is not included in the file nsLocalFileUnix.cpp.
Comment 2 Philipp Middendorf 2016-04-16 08:28:00 UTC
On even closer examination, it's probably caused by this patch for glibc-2.23:

https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

#including sys/sysmacros.h should mitigate it. I don't have time to post a patch for that currently, though.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2016-12-18 14:36:40 UTC
Created attachment 456576 [details, diff]
firefox-50.1.0-glibc-2.24.patch

glibc-2.24 also exposes the lack of major() macro problem.
firefox-50.1.0-glibc-2.24.patch is a crude workaround to get firefox building.

I don't understand yet why visibility change is required to force symbols
get resolved.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2016-12-19 15:58:58 UTC
Thanks for the patch!  Once i'm back at a computer that can do commits (1-2 days) i'll try and get this patch in place.
Comment 5 Jory A. Pratt gentoo-dev 2017-01-06 20:04:51 UTC
*** Bug 604412 has been marked as a duplicate of this bug. ***
Comment 6 Anthony Ryan 2017-01-10 12:51:43 UTC
I've opened an issue upstream here: https://bugzilla.mozilla.org/show_bug.cgi?id=1329798
Comment 7 Jory A. Pratt gentoo-dev 2017-01-15 11:34:52 UTC
*** Bug 605748 has been marked as a duplicate of this bug. ***
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-02 07:14:41 UTC
Created attachment 462198 [details, diff]
Upstreamable patch

Here's a better patch. It adds a check for systems that do not have that header, and fixes visibility correctly. Note that if you use ccache, you may need to clear the cache due to visibility magic changes.
Comment 9 Jory A. Pratt gentoo-dev 2017-02-10 01:29:44 UTC
I have gone ahead and updated the patchset for firefox/thunderbird-52.0 in the mozilla overlay. We will not back port to esr which is intended for stable system setups only.
Comment 10 Jory A. Pratt gentoo-dev 2017-08-26 17:56:56 UTC
If you feel I have closed your bug and it is still a current issue, please reopen and update it completely. We will not work bugs that have no ebuild in tree any longer or can not be reproduced with a current system.

Thank You for your support and understanding
The Mozilla Team