__linux not defined on older PowerPPC

VERIFIED FIXED in 3.1.2

Status

NSS
Libraries
P1
normal
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: jsmith, Assigned: Wan-Teh Chang)

Tracking

3.1.2
PowerPC
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
__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

Comment 1

18 years ago
*** Bug 63936 has been marked as a duplicate of this bug. ***

Comment 2

18 years ago
Changed Summary and marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Build → __linux__ not defined on older PowerPPC

Comment 3

18 years ago
Reassigning
Assignee: ddrinan → javi

Comment 4

18 years ago
re-assigning to NSS team
Assignee: javi → wtc
(Assignee)

Comment 5

18 years ago
Created attachment 22510 [details] [diff] [review]
Proposed patch.  Use the LINUX macro, which is defined by the NSS makefiles.
(Assignee)

Updated

18 years ago
Component: Client Library → Libraries
Product: PSM → NSS
Target Milestone: --- → 3.2
Version: 1.01 → 3.0

Comment 6

18 years ago
__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)

Comment 7

18 years ago
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.
(Reporter)

Comment 8

18 years ago
Created attachment 22831 [details] [diff] [review]
Patch to fix Linux POSIX compliance, all 6 instances
(Reporter)

Comment 9

18 years ago
Oops, that patch is on crack, sorry. 
(Reporter)

Comment 10

18 years ago
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. 
(Assignee)

Updated

18 years ago
Priority: -- → P3
(Assignee)

Comment 11

18 years ago
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
(Assignee)

Updated

18 years ago
Priority: P3 → P1
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.
(Assignee)

Comment 14

18 years ago
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. 1.4.2.1 to
include this fix?  Thanks.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Target Milestone: 3.2 → 3.1.2

Comment 15

18 years ago
Tag has been moved.

Comment 16

17 years ago
Verified per javi's comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.