Bug 6566

Summary: PHP segfault when crosscompiled to mips64 - patch included
Product: buildroot Reporter: Cassiano Martin <cassiano>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: buildroot, cassiano
Priority: P5    
Version: 2013.08   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:
Attachments: endian fix

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.