Last Comment Bug 714312 - detect machine/endian.h to get endianess on BSD systems
: detect machine/endian.h to get endianess on BSD systems
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 OpenBSD
: -- normal (vote)
: mozilla12
Assigned To: Landry Breuil (:gaston)
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-30 10:47 PST by Landry Breuil (:gaston)
Modified: 2012-01-10 01:57 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Detect and use machine/endian.h (2.72 KB, patch)
2011-12-30 10:49 PST, Landry Breuil (:gaston)
ted: review+
Details | Diff | Splinter Review
Detect and use machine/endian.h (2.79 KB, patch)
2012-01-09 12:27 PST, Landry Breuil (:gaston)
ted: review+
Details | Diff | Splinter Review

Description Landry Breuil (:gaston) 2011-12-30 10:47:32 PST
Followup to bug #694499, endianess detection fails now on OpenBSD (and probably Net/Free too), since include/endian.h doesn't exist there. A common denominator is to include machine/endian.h, which defines _BYTE_ORDER (directly, or via another inclusion). Note that on OpenBSD, we need to include sys/types.h first.
Comment 1 Landry Breuil (:gaston) 2011-12-30 10:49:40 PST
Created attachment 584993 [details] [diff] [review]
Detect and use machine/endian.h

Proposed configure.in/jscpucfg.h/config.h.in patch to check and use machine/endian.h, tested on OpenBSD, probably works on Net/Free.
Comment 2 Bill Gianopoulos [:WG9s] 2012-01-08 11:15:50 PST
It was reported on IRC that adding this patch is sufficient to get current trunk to work on OpenBSD.  Perhaps a higher priority is therefore appropriate?
Comment 3 Ted Mielczarek [:ted.mielczarek] 2012-01-09 04:51:41 PST
Comment on attachment 584993 [details] [diff] [review]
Detect and use machine/endian.h

Review of attachment 584993 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with one style nit.

::: js/src/configure.in
@@ +2948,5 @@
>  if test "$ac_cv_header_endian_h" = yes; then
>      AC_DEFINE(JS_HAVE_ENDIAN_H)
>  fi
>  
> +MOZ_CHECK_HEADER([machine/endian.h],[AC_DEFINE(JS_HAVE_MACHINE_ENDIAN_H)],[],[#include <sys/types.h>])

Can you write this check in the same style as the surrounding checks?
Comment 4 Landry Breuil (:gaston) 2012-01-09 12:27:30 PST
Created attachment 587078 [details] [diff] [review]
Detect and use machine/endian.h

Assuming that's what you meant, here's a new one with :

MOZ_CHECK_HEADERS([machine/endian.h],[],[],[#include <sys/types.h>])
if test "$ac_cv_header_machine_endian_h" = yes; then
    AC_DEFINE(JS_HAVE_MACHINE_ENDIAN_H)
fi
Comment 5 Ted Mielczarek [:ted.mielczarek] 2012-01-09 12:29:40 PST
Comment on attachment 587078 [details] [diff] [review]
Detect and use machine/endian.h

Review of attachment 587078 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, thanks!
Comment 6 Jeff Walden [:Waldo] (remove +bmo to email) 2012-01-09 15:42:00 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/9cfdb612a026

In the future, it'd help if you could make sure to include the bug number in the patch.  (Some people will also want the r=... in it as well.  Seeing as the reviewed version can't have that except anticipatorily, I'm happy to take 'em as they come on that point, myself.  :-) )
Comment 7 Marco Bonardo [::mak] 2012-01-10 01:57:01 PST
https://hg.mozilla.org/mozilla-central/rev/9cfdb612a026

Note You need to log in before you can comment on or make changes to this bug.