Closed Bug 501894 Opened 15 years ago Closed 14 years ago

AIX linker error for 3.6a1pre source mozilla/layout/build : Undefined symbol: .alloca

Categories

(Core :: Audio/Video, defect)

Other
AIX
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: shailen.n.jain, Assigned: shailen.n.jain)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11

While building mozilla/layout/build getting the below linker error

ld: 0711-317 ERROR: Undefined symbol: .alloca
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gmake[1]: *** [libgklayout.so] Error 8
gmake[1]: Leaving directory
`/home/guest/sb/mercurial/mozilla/obj-opt/layout/build'


Reproducible: Always

Steps to Reproduce:
1.Build Mozilla Firefox 3.6a1pre build on AIX with Gnome RPMS of 64 bit
version.

2.
3.
Actual Results:  
Build fails with the above error.


Expected Results:  
No build failure
OS: Windows XP → AIX
Hardware: x86 → Other
Attached patch Patch V 1 (obsolete) — Splinter Review
Submitted the patch to resolve the linker error
Attachment #386464 - Flags: review?(roc)
Wouldn't it make more sense to #define alloca to __alloca for AIX?
Attached patch Patch V 2Splinter Review
The AIX compiler automatically substitutes calls to the system alloca function with an inline built-in function __alloca in any of the following cases: 

1. Include the header file alloca.h
2. Compile with -Dalloca=__alloca
3. Directly call the built-in function using the form __alloca

Since #1 did not resolve the issue, I followed #3 in the earlier patch ( Patch V1)

With the new patch (Patch V2), I followed the approach #2.

Please let me know if this is fine.
Attachment #386464 - Attachment is obsolete: true
Attachment #386481 - Flags: review?(roc)
Attachment #386464 - Flags: review?(roc)
Component: General → Video/Audio
Product: Firefox → Core
QA Contact: general → video.audio
This is fine. However, you need to format your patch with an entry in the README file and a change to update.sh, like the other patches we have.
It's a change to Makefile.in which is a Mozilla specific file so is fine not to have the other changes - it won't be upstreamed.
Robert :

Since the Patch V2 contains only changes to Makefile.in, can you please review the patch ?
Keywords: checkin-needed
patch fails to apply
Assignee: nobody → shailen.n.jain
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: checkin-needed
(In reply to comment #3)
> Created an attachment (id=386481) [details]
> Patch V 2
> 
> The AIX compiler automatically substitutes calls to the system alloca function
> with an inline built-in function __alloca in any of the following cases: 
> 
> 1. Include the header file alloca.h
> 2. Compile with -Dalloca=__alloca
> 3. Directly call the built-in function using the form __alloca
> 

Suggestion: you only need to add the "-qalloca" compiler flag in Makefile.in
Less patch doing the same

...
ifeq ($(OS_ARCH),AIX)
MODULE_OPTIMIZE_FLAGS += -qalloca -O2 -qarch=com -qalign=full -qmaxmem=-1
endif

include $(topsrcdir)/config/rules.mk
I tried with the below option but could not get rid of the error.

MODULE_OPTIMIZE_FLAGS += -qalloca

The patch submitted worked fine to resolve the issue.
Keywords: checkin-needed
I believe the -qalloca flag behaviour changed slightly between XLC8 and XLC9

With V8 compiler (or earlier) passing -qalloca flag is sufficiant for the inline version of alloca. So no linker error later, if __alloca() is in source.

This flag won't help here, if the missing .alloca symbol must be linked to an object from another source dir.

AFAIR, the multimedia codecs objects are calling alloca.
When linking libgklayout.so with -bnoquiet you can see which object tries to call the unresolved external symbol.
patch doesn't apply
Keywords: checkin-needed
what errors are you getting ?
Attachment #386481 - Flags: superreview?(chris.double)
Patch applies to trunk for me.

We ran into the same problem with the Solaris build.  The fix there was to supply alloca.diff, which patches os.h to define HAVE_ALLOCA_H for Solaris.  We could extend that to handle AIX too.
Comment on attachment 386481 [details] [diff] [review]
Patch V 2

I'm not a super reviewer. roc's r+ is fine for this.
Attachment #386481 - Flags: superreview?(chris.double)
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/82747ecf81dd
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: