Bug 6566 - PHP segfault when crosscompiled to mips64 - patch included
Summary: PHP segfault when crosscompiled to mips64 - patch included
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2013.08
Hardware: Other Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 23:28 UTC by Cassiano Martin
Modified: 2013-10-23 22:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
endian fix (650 bytes, patch)
2013-10-18 23:28 UTC, Cassiano Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cassiano Martin 2013-10-18 23:28:34 UTC
Created attachment 5084 [details]
endian fix

PHP crashes with a segfault when compiled do mips64r2 n32.

Any function related to timezone gives a segfault, like date(), gettimeofday(), and some other random errors, like microtime() dumping garbage on the screen.

I found out that autoconf did not set some macros when configuring, resulting little endian code being compiled to a big endian machine.

A simple test can be done on a mips64 machine:

php -r 'print_r(date('l'));'

Result in segfault instantly.

Attached is a patch that solves this issue.
Comment 1 Peter Korsgaard 2013-10-23 22:46:13 UTC
Thanks, I've committed a slightly tweaked patch (use our existing BR2_ENDIAN symbol instead) as 21a4a9003e3.