__linux is not defined in older compilers and across all Linux platforms but __linux__ is. This stops the build on many Linux-PowerPC distros due to GiveSystemInfo not being defined because __linux does not catch. -jeramy b smith --- mozilla/security/nss/lib/util/unix_rand.c Fri Sep 29 12:42:39 2000 +++ mozilla/security/nss/lib/util/unix_rand.c.ppc Thu Dec 28 18:24:55 2000 @@ -262,7 +262,7 @@ } #endif /* IBM R2 */ ^L -#if defined(__linux) +#if defined(__linux__) #include <linux/kernel.h> static size_t
*** Bug 63936 has been marked as a duplicate of this bug. ***
Changed Summary and marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Build → __linux__ not defined on older PowerPPC
Assignee: ddrinan → javi
re-assigning to NSS team
Assignee: javi → wtc
Created attachment 22510 [details] [diff] [review] Proposed patch. Use the LINUX macro, which is defined by the NSS makefiles.
Component: Client Library → Libraries
Product: PSM → NSS
Target Milestone: --- → 3.2
Version: 1.01 → 3.0
__linux exists in other sources (not NSS, sorry). I found them. /dbm/include/mcom_db.h, line 73 -- #if defined(__linux) || defined(__BEOS__) /dbm/include/mcom_db.h, line 80 -- #endif /* __linux */ /dbm/src/ndbm.c, line 51 -- #if defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 60 -- #if defined(AIX) || defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 70 -- #if defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 60 -- #if defined(AIX) || defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 70 -- #if defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 60 -- #if defined(AIX) || defined(__linux) /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 70 -- #if defined(__linux)
Oh, I failed. /dbm/include/mcom_db.h, line 73 /dbm/src/ndbm.c, line 51 /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 60 /netwerk/dns/daemon/nsDnsAsyncLookup.cpp, line 70 /netwerk/test/TestDNSDaemon.cpp, line 30 /netwerk/test/TestDNSDaemon.cpp, line 34 /nsprpub/pr/include/gencfg.c, line 46 # "__linux__" is POSIX compliant. "linux" and "__linux" is not (from GCC FAQ). # And this bug have an effect on Linux Alpha envs.
Created attachment 22831 [details] [diff] [review] Patch to fix Linux POSIX compliance, all 6 instances
Oops, that patch is on crack, sorry.
Okay, here is a new patch: http://penguinppc.org/~jeramy/mozilla-linux-posix.patch . This should clean up all __linux references and change them to __linux__ . I have not gone through. This does not change 'linux' references but only __linux.
Where can I read about the claim that "__linux__" is POSIX compliant? Unless I am convinced that __linux__ is the macro to use, I'm planning to fix this in one of two ways. 1. Use our own macro LINUX, which is defined by the -DLINUX compiler flag we use. 2. Test for both __linux and __linux__. Please let me know which one is more to your liking. By the way, I will only fix the files under mozilla/security and mozilla/nsprpub, as these are the projects I am working on.
Status: NEW → ASSIGNED
Summary: __linux__ not defined on older PowerPPC → __linux not defined on older PowerPPC
Yes, this bug seems to cover code in numerous different bugzilla "products". A separate bug for each product should be filed.
Wan-Teh, your patch looks correct for NSS.
I checked in my patch (id=22510) on the tip and NSS_3_1_BRANCH. Javi, could you move the NSS_CLIENT_TAG on mozilla/security/nss/lib/util/unix_rand.c to rev. 22.214.171.124 to include this fix? Thanks.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Target Milestone: 3.2 → 3.1.2
Tag has been moved.
Verified per javi's comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.