Bug 47873

Summary: [PATCH v2] Building libxatracker.o is broken when using --enable-32-bit on a 64bit OS
Product: Mesa Reporter: Alexandre Demers <alexandre.f.demers>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: missing DEFINES and CFLAGS
Adding missing CFLAGS

Description Alexandre Demers 2012-03-25 16:54:56 UTC
When building 32bit mesa on 64bit OS using --enable-32-bit, I receive the following error:
./src/gallium/state_trackers/xa$ gcc -r -nostdlib -o libxatracker.o xa_tracker.o xa_context.o xa_renderer.o xa_tgsi.o xa_yuv.o xa_composite.o
/usr/bin/ld: Relocatable linking with relocations from format elf32-i386 (xa_tracker.o) to format elf64-x86-64 (libxatracker.o) is not supported
collect2: ld returned 1 exit status

However, adding -m32 fixes it. So, it seems this command doesn't take into account the -m32 flag.
Comment 1 Alexandre Demers 2012-03-27 21:43:06 UTC
Created attachment 59135 [details] [review]
missing DEFINES and CFLAGS

This fixes the build (missing DEFINES and CFLAGS).
Comment 2 Zack Rusin 2012-03-29 13:59:40 UTC
Comment on attachment 59135 [details] [review]
missing DEFINES and CFLAGS

Review of attachment 59135 [details] [review]:
-----------------------------------------------------------------

-	$(CC) -r -nostdlib -o $(XA_LIB_NAME) $(OBJECTS)
+	$(CC) -r -nostdlib -o $(XA_LIB_NAME) $(OBJECTS) $(CFLAGS) 

is enough, right? CFLAGS should already include DEFINES and CFLAGS is already present in the building-the-object-file line.
Comment 3 Alexandre Demers 2012-03-29 14:04:10 UTC
(In reply to comment #2)
> Comment on attachment 59135 [details] [review] [review]
> missing DEFINES and CFLAGS
> 
> Review of attachment 59135 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> -    $(CC) -r -nostdlib -o $(XA_LIB_NAME) $(OBJECTS)
> +    $(CC) -r -nostdlib -o $(XA_LIB_NAME) $(OBJECTS) $(CFLAGS) 
> 
> is enough, right? CFLAGS should already include DEFINES and CFLAGS is already
> present in the building-the-object-file line.

I'll test it later tonight when I'll be back home. I suppose it should be enough, but I choosed to add both as it is done like that in other trackers.
Comment 4 Alexandre Demers 2012-03-29 21:53:56 UTC
Created attachment 59251 [details] [review]
Adding missing CFLAGS

Removed $DEFINES since it is already covered by $CFLAGS.
Comment 5 Alexandre Demers 2012-04-03 21:49:05 UTC
Could someone review this simple patch and commit it if good please? It adds a missing CFLAGS when compiling.
Comment 6 Zack Rusin 2012-04-04 21:24:16 UTC
Done (commit 129d5138d63697a9812d531895293313dfad6d57). Thanks for the patch and sorry for the delay. JFYI, it's in general a lot quicker if you generate a proper git patch (git format-patch) and send it to the list.
Comment 7 Alexandre Demers 2012-04-05 05:19:38 UTC
Thank you. About your comment on generating a proper git patch, I was told the same for another patch yesterday morning. So it's noted and I'll remember it for next time.

(In reply to comment #6)
> Done (commit 129d5138d63697a9812d531895293313dfad6d57). Thanks for the patch
> and sorry for the delay. JFYI, it's in general a lot quicker if you generate a
> proper git patch (git format-patch) and send it to the list.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.