From: Török E. <edw...@gm...> - 2010-02-25 15:40:45
|
Hi, I had to apply the following patch to build mesa as 32-bit, on a 64-bit Debian system (so that wine, and all else get proper 3D accelereration with the new r600 driver). progs/glsl is built by default, but it was not using -m32. Please apply the patch to mesa git master, it is a one-line makefile fix. Best regards, --Edwin |
From: Török E. <edw...@gm...> - 2010-02-25 15:40:41
|
--- progs/glsl/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index 8928c83..aaa54cb 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ # using : to avoid APP_CC pointing to CC loop CC := $(APP_CC) CFLAGS := -I$(INCDIR) $(CFLAGS) -LDLIBS = $(LIBS) +LDLIBS = $(LIBS) $(ARCH_FLAGS) PROG_SOURCES = \ array.c \ -- 1.7.0 |
From: Brian P. <br...@vm...> - 2010-02-25 16:03:52
|
Török Edvin wrote: > Hi, > > I had to apply the following patch to build mesa as 32-bit, > on a 64-bit Debian system (so that wine, and all else get proper > 3D accelereration with the new r600 driver). > > progs/glsl is built by default, but it was not using -m32. > Please apply the patch to mesa git master, it is a one-line makefile fix. Committed. Thanks. -Brian |
From: Dan N. <dbn...@gm...> - 2010-02-26 14:19:49
|
2010/2/25 Török Edvin <edw...@gm...>: > --- > progs/glsl/Makefile | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile > index 8928c83..aaa54cb 100644 > --- a/progs/glsl/Makefile > +++ b/progs/glsl/Makefile > @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ > # using : to avoid APP_CC pointing to CC loop > CC := $(APP_CC) > CFLAGS := -I$(INCDIR) $(CFLAGS) > -LDLIBS = $(LIBS) > +LDLIBS = $(LIBS) $(ARCH_FLAGS) Can you show the error you're getting? This should already be handled in CFLAGS, but I suspect using make's implicit rules is causing this problem. -- Dan |
From: Török E. <edw...@gm...> - 2010-02-26 14:26:48
|
On 02/26/2010 04:19 PM, Dan Nicholson wrote: > 2010/2/25 Török Edvin <edw...@gm...>: >> --- >> progs/glsl/Makefile | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile >> index 8928c83..aaa54cb 100644 >> --- a/progs/glsl/Makefile >> +++ b/progs/glsl/Makefile >> @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ >> # using : to avoid APP_CC pointing to CC loop >> CC := $(APP_CC) >> CFLAGS := -I$(INCDIR) $(CFLAGS) >> -LDLIBS = $(LIBS) >> +LDLIBS = $(LIBS) $(ARCH_FLAGS) > > Can you show the error you're getting? This should already be handled > in CFLAGS, but I suspect using make's implicit rules is causing this > problem. CFLAGS is not used when linking .o files only, so the command-line doesn't have -m32 at all: gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU -lGL -lm -o array /usr/bin/ld: skipping incompatible ../../lib32/libglut.so when searching for -lglut /usr/bin/ld: cannot find -lglut collect2: ld returned 1 exit status And with that patch applied it correctly adds -m32 to the commandline and links: gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU -lGL -lm -m32 -o array Best regards, --Edwin |
From: Dan N. <dbn...@gm...> - 2010-02-26 14:51:06
|
2010/2/26 Török Edwin <edw...@gm...>: > On 02/26/2010 04:19 PM, Dan Nicholson wrote: >> 2010/2/25 Török Edvin <edw...@gm...>: >>> --- >>> progs/glsl/Makefile | 2 +- >>> 1 files changed, 1 insertions(+), 1 deletions(-) >>> >>> diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile >>> index 8928c83..aaa54cb 100644 >>> --- a/progs/glsl/Makefile >>> +++ b/progs/glsl/Makefile >>> @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ >>> # using : to avoid APP_CC pointing to CC loop >>> CC := $(APP_CC) >>> CFLAGS := -I$(INCDIR) $(CFLAGS) >>> -LDLIBS = $(LIBS) >>> +LDLIBS = $(LIBS) $(ARCH_FLAGS) >> >> Can you show the error you're getting? This should already be handled >> in CFLAGS, but I suspect using make's implicit rules is causing this >> problem. > > CFLAGS is not used when linking .o files only, so the command-line > doesn't have -m32 at all: Yeah, the built-in make pattern rule for linking .o files doesn't pass CFLAGS. We usually handle this by not using make's built-in rules for linking. > gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU > -lGL -lm -o array > /usr/bin/ld: skipping incompatible ../../lib32/libglut.so when searching > for -lglut > /usr/bin/ld: cannot find -lglut > collect2: ld returned 1 exit status > > And with that patch applied it correctly adds -m32 to the commandline > and links: > gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU > -lGL -lm -m32 -o array These programs aren't in progs/glsl. Are you sure this is solving your problem? Can you just show me the make output for the failed run? -- Dan |
From: Török E. <edw...@gm...> - 2010-02-26 14:59:26
|
On 2010-02-26 16:50, Dan Nicholson wrote: >> gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU >> -lGL -lm -m32 -o array > > These programs aren't in progs/glsl. Are you sure this is solving your > problem? Can you just show me the make output for the failed run? They are, I use git master, on this commit: commit e5c691f445e1c02e6e2f75b817b13d7024f7a3a6 Author: Vinson Lee <vl...@vm...> Date: Fri Feb 26 00:17:03 2010 -0800 r300/compiler: Assert that array index is not negative. ls -l progs/glsl/shaderutil.c progs/glsl/array.c -rw-r--r-- 1 edwin edwin 4838 Feb 23 22:26 progs/glsl/array.c make[1]: Entering directory `/home/edwin/mesa/progs/glsl' cp ../../progs/util/extfuncs.h . cp ../../progs/util/shaderutil.h . cp ../../progs/util/readtex.h . gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o array.o array.c cp ../../progs/util/shaderutil.c . gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o shaderutil.o shaderutil.c cp ../../progs/util/readtex.c . gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o readtex.o readtex.c gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU -lGL -lm -o array /usr/bin/ld: skipping incompatible ../../lib32/libglut.so when searching for -lglut /usr/bin/ld: cannot find -lglut collect2: ld returned 1 exit status make[1]: *** [array] Error 1 make[1]: Leaving directory `/home/edwin/mesa/progs/glsl' |
From: Dan N. <dbn...@gm...> - 2010-02-26 18:08:18
|
On Fri, Feb 26, 2010 at 04:53:48PM +0200, Török Edwin wrote: > On 2010-02-26 16:50, Dan Nicholson wrote: > >> gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU > >> -lGL -lm -m32 -o array > > > > These programs aren't in progs/glsl. Are you sure this is solving your > > problem? Can you just show me the make output for the failed run? > > They are, I use git master, on this commit: > commit e5c691f445e1c02e6e2f75b817b13d7024f7a3a6 > Author: Vinson Lee <vl...@vm...> > Date: Fri Feb 26 00:17:03 2010 -0800 > > r300/compiler: Assert that array index is not negative. > > ls -l progs/glsl/shaderutil.c progs/glsl/array.c > -rw-r--r-- 1 edwin edwin 4838 Feb 23 22:26 progs/glsl/array.c > > make[1]: Entering directory `/home/edwin/mesa/progs/glsl' > cp ../../progs/util/extfuncs.h . > cp ../../progs/util/shaderutil.h . > cp ../../progs/util/readtex.h . > gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 > -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 > -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE > -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS > -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING > -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o array.o array.c > cp ../../progs/util/shaderutil.c . > gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 > -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 > -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE > -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS > -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING > -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o shaderutil.o shaderutil.c > cp ../../progs/util/readtex.c . > gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 > -ffast-math -fvisibility=hidden -fno-strict-aliasing -m32 -fPIC -m32 > -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -D_GNU_SOURCE > -DPTHREADS -DHAVE_POSIX_MEMALIGN -DGLX_USE_TLS -DPTHREADS > -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING > -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -c -o readtex.o readtex.c > gcc array.o shaderutil.o readtex.o -L../../lib32 -lglut -lGLEW -lGLU > -lGL -lm -o array > /usr/bin/ld: skipping incompatible ../../lib32/libglut.so when searching > for -lglut > /usr/bin/ld: cannot find -lglut > collect2: ld returned 1 exit status > make[1]: *** [array] Error 1 > make[1]: Leaving directory `/home/edwin/mesa/progs/glsl' Can you try the patch below? I think this fixes the issue more generally. -- Dan >From bf51ca551c4e4b994d15f3d6b374c5e5b21ece4e Mon Sep 17 00:00:00 2001 From: Dan Nicholson <dbn...@gm...> Date: Fri, 26 Feb 2010 10:01:37 -0800 Subject: [PATCH] progs/glsl: Ensure CFLAGS are passed during linking Commit ab6825b3e3fd04564b7840e945fa32b0a7b3c0c2 fixed an issue where the architecture option -m32 wasn't being passed to the compiler when linking .o files. This would only fix the issue with user's building with the hacky --enable-32-bit. The right way to fix this is to pass CFLAGS to the linker, which the GNU make builtin rules unfortunately don't do. Signed-off-by: Dan Nicholson <dbn...@gm...> --- progs/glsl/Makefile | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index aaa54cb..3b5a595 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ # using : to avoid APP_CC pointing to CC loop CC := $(APP_CC) CFLAGS := -I$(INCDIR) $(CFLAGS) -LDLIBS = $(LIBS) $(ARCH_FLAGS) +LDLIBS = $(LIBS) PROG_SOURCES = \ array.c \ @@ -69,6 +69,9 @@ $(PROG_OBJS): $(UTIL_HEADERS) $(PROGS): $(UTIL_OBJS) +.o: + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ + clean: -rm -f $(PROGS) -rm -f *.o *~ -- 1.6.6.1 |
From: Török E. <edw...@gm...> - 2010-02-26 18:58:00
|
On 02/26/2010 08:08 PM, Dan Nicholson wrote: > > Can you try the patch below? I think this fixes the issue more generally. Yes, this one fixes the linking issue too. You can commit this one instead of mine. > > -- > Dan > > From bf51ca551c4e4b994d15f3d6b374c5e5b21ece4e Mon Sep 17 00:00:00 2001 > From: Dan Nicholson <dbn...@gm...> > Date: Fri, 26 Feb 2010 10:01:37 -0800 > Subject: [PATCH] progs/glsl: Ensure CFLAGS are passed during linking > > Commit ab6825b3e3fd04564b7840e945fa32b0a7b3c0c2 fixed an issue where the > architecture option -m32 wasn't being passed to the compiler when > linking .o files. This would only fix the issue with user's building > with the hacky --enable-32-bit. The right way to fix this is to pass > CFLAGS to the linker, which the GNU make builtin rules unfortunately > don't do. > > Signed-off-by: Dan Nicholson <dbn...@gm...> > --- > progs/glsl/Makefile | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile > index aaa54cb..3b5a595 100644 > --- a/progs/glsl/Makefile > +++ b/progs/glsl/Makefile > @@ -16,7 +16,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ > # using : to avoid APP_CC pointing to CC loop > CC := $(APP_CC) > CFLAGS := -I$(INCDIR) $(CFLAGS) > -LDLIBS = $(LIBS) $(ARCH_FLAGS) > +LDLIBS = $(LIBS) > > PROG_SOURCES = \ > array.c \ > @@ -69,6 +69,9 @@ $(PROG_OBJS): $(UTIL_HEADERS) > > $(PROGS): $(UTIL_OBJS) > > +.o: > + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ > + > clean: > -rm -f $(PROGS) > -rm -f *.o *~ |
From: Dan N. <dbn...@gm...> - 2010-02-26 19:05:05
|
2010/2/26 Török Edwin <edw...@gm...>: > On 02/26/2010 08:08 PM, Dan Nicholson wrote: >> >> Can you try the patch below? I think this fixes the issue more generally. > > Yes, this one fixes the linking issue too. You can commit this one > instead of mine. Thanks. -- Dan |