Closed Bug 1104651 Opened 5 years ago Closed 5 years ago

[gonk-l] valloc is not defined in newer bionic

Categories

(Firefox OS Graveyard :: General, defect, major)

x86_64
Gonk (Firefox OS)
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
2.2 S2 (19dec)

People

(Reporter: seinlin, Assigned: mwu)

References

Details

Attachments

(1 file, 3 obsolete files)

No description provided.
Attached patch Make valloc optional (obsolete) — Splinter Review
Valloc is deprecated in Android 5.0. See http://androidxref.com/5.0.0_r2/xref/bionic/libc/private/bionic_config.h#20 .
Assignee: nobody → mwu
Attached patch Make valloc optional, v2 (obsolete) — Splinter Review
Attachment #8537556 - Attachment is obsolete: true
Attachment #8537820 - Flags: review?(mh+mozilla)
Comment on attachment 8537820 [details] [diff] [review]
Make valloc optional, v2

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

::: configure.in
@@ +3413,5 @@
> +                               ac_cv_func_valloc=no)])
> +
> +if test "$ac_cv_func_valloc" = yes; then
> +  AC_DEFINE(HAVE_VALLOC)
> +fi

How about AC_EGREP_HEADER(valloc, malloc.h, AC_DEFINE(HAVE_VALLOC))?
Attachment #8537820 - Flags: review?(mh+mozilla)
(In reply to Mike Hommey [:glandium] from comment #5)
> How about AC_EGREP_HEADER(valloc, malloc.h, AC_DEFINE(HAVE_VALLOC))?

Should work for glibc and bionic, but I'm not sure about bsd. Some quick searching suggest that bsds define valloc in unistd.h so we'll need to add something for that.
Attached patch Make valloc optional, v3 (obsolete) — Splinter Review
Attachment #8537820 - Attachment is obsolete: true
Comment on attachment 8538528 [details] [diff] [review]
Make valloc optional, v3

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

Seems to work. The only drawback is that this macro doesn't report success or failure, so it's harder to tell if valloc is enabled or not. However, searching the build logs for HAVE_VALLOC on OSX and Linux works, so that's close enough.
Attachment #8538528 - Flags: review?(mh+mozilla)
Comment on attachment 8538528 [details] [diff] [review]
Make valloc optional, v3

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

::: configure.in
@@ +3398,5 @@
>  AC_CHECK_FUNCS(malloc_usable_size)
>  
> +dnl In newer bionic headers, valloc is built but not defined,
> +dnl so we check more carefully here.
> +AC_EGREP_HEADER(valloc, malloc.h, AC_DEFINE(HAVE_VALLOC))

(In reply to Michael Wu [:mwu] from comment #9)
> Seems to work. The only drawback is that this macro doesn't report success
> or failure, so it's harder to tell if valloc is enabled or not.

AC_MSG_CHECKING([for valloc in malloc.h])
AC_EGREP_HEADER(valloc, malloc.h, AC_DEFINE(HAVE_VALLOC)AC_MSG_RESULT([yes]),AC_MSG_RESULT([no]))
Attachment #8538528 - Flags: review?(mh+mozilla) → review+
A bit more verbose, but still simpler than AC_TRY_COMPILE.
Attachment #8538528 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/a5e74ea5a159
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S2 (19dec)
Duplicate of this bug: 1092003
You need to log in before you can comment on or make changes to this bug.