Closed Bug 528131 Opened 15 years ago Closed 14 years ago

build config should check whether __force_align_arg_pointer__ is valid

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(3 files, 1 obsolete file)

from bug 512865 comment #24

SSE2 code on gcc uses __force_align_arg_pointer__ for aligned access.
__force_align_arg_pointer__ is invalid on old gcc such as version 4.1.
So we should check whether our gcc support __force_align_arg_pointer__ into configure.in.  If not support, we doesn't use SSE2 code.

Also, this check needs pixman SSE2 code.
Blocks: 488851
Attached patch patch v1Splinter Review
Attachment #421397 - Flags: review?(ted.mielczarek)
Comment on attachment 421397 [details] [diff] [review]
patch v1

For consistency with other checks, reverse the state of the variable, and call it "HAVE_GCC_ALIGN_ARG_POINTER".
Attachment #421397 - Flags: review?(ted.mielczarek) → review-
Attached patch patch v2 (obsolete) — Splinter Review
Attachment #425159 - Flags: review?(ted.mielczarek)
Comment on attachment 425159 [details] [diff] [review]
patch v2

Is there a reason you didn't use AC_TRY_COMPILE here? That's generally more readable.
Attached patch patch v3Splinter Review
Attachment #425159 - Attachment is obsolete: true
Attachment #425159 - Flags: review?(ted.mielczarek)
Comment on attachment 426640 [details] [diff] [review]
patch v3

change to AC_TRY_COMPILE
Attachment #426640 - Flags: review?(ted.mielczarek)
Comment on attachment 426640 [details] [diff] [review]
patch v3

>diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
>--- a/config/autoconf.mk.in
>+++ b/config/autoconf.mk.in
>@@ -644,6 +644,7 @@ WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCL
> 
> HAVE_ARM_SIMD = @HAVE_ARM_SIMD@
> HAVE_ARM_NEON = @HAVE_ARM_NEON@
>+HAVE_GCC_ALIGN_ARG_POINTER = @HAVE_GCC_ALIGN_ARG_POINTER@
> 
> MOZ_SPLASHSCREEN = @MOZ_SPLASHSCREEN@
> 
>diff --git a/configure.in b/configure.in
>--- a/configure.in
>+++ b/configure.in
>@@ -3128,6 +3128,26 @@ fi         # Sun Studio on Solaris
> AC_SUBST(WRAP_SYSTEM_INCLUDES)
> AC_SUBST(VISIBILITY_FLAGS)
> 
>+dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
>+dnl ========================================================
>+if test "$GNU_CC"; then
>+  CFLAGS_save="${CFLAGS}"
>+  CFLAGS="${CFLAGS} -Werror"
>+  AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
>+                 ac_cv_force_align_arg_pointer,
>+                 [AC_TRY_COMPILE([],
>+                                 [__attribute__ ((__force_align_arg_pointer__)) void test() {}],

I think you want to put your test code in the first argument to AC_TRY_COMPILE here, since that gets inserted at the top of the source file (also used for #includes). The second argument is inserted inside main(), and I'm not sure if that will work properly with your declaration.

r=me with that fixed.
Attachment #426640 - Flags: review?(ted.mielczarek) → review+
landed
http://hg.mozilla.org/mozilla-central/rev/37dc1ce4708d
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: