Bug 138923 - gcc problem compiling samba-3.0.8
Summary: gcc problem compiling samba-3.0.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: 3
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-11 22:50 UTC by shane_drinkwater
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-11-17 10:02:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
the error as shown by make on a vanilla samba (-save-temps added) (1.38 KB, text/plain)
2004-11-16 13:38 UTC, Thomas M Steenholdt
no flags Details
the asm code that as chokes on (4.75 KB, text/plain)
2004-11-16 13:39 UTC, Thomas M Steenholdt
no flags Details
dynconfig.i (857.69 KB, text/plain)
2004-11-16 14:00 UTC, Thomas M Steenholdt
no flags Details

Description shane_drinkwater 2004-11-11 22:50:25 UTC
Description of problem:
I am having problems compiling samba-3.0.8 on fedora core 3 64 bit. The
error message I am getting is:
Compiling dynconfig.c
/tmp/ccY0PMTp.s: Assembler messages:
/tmp/ccY0PMTp.s:44: Error: suffix or operands invalid for `mov'
/tmp/ccY0PMTp.s:97: Error: suffix or operands invalid for `mov'
make: *** [dynconfig.o] Error 1






Version-Release number of selected component (if applicable):
gcc version -->gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
Samba --> samba-3.0.8


How reproducible:
every time(Very)


Steps to Reproduce:
1.download samba-3.0.8 from samba.org
2.ungzip and tarball tar -xvf 
3.config with ./configure --with-winbind --with-pam --with-smbmount
--enable-cups
4. type make
5. in seconds up comes the error

  
Actual results:
[root@mercyrouter source]# make
Using FLAGS =  -O -I/usr/local/cups/include  -Iinclude
-I/usr/src/samba-3.0.8/source/include
-I/usr/src/samba-3.0.8/source/ubiqx -I/usr/src/sam
ba-3.0.8/source/smbwrapper  -I. -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/usr/src/samba-3.0.8/source
      LIBS = -lcrypt -lnsl -ldl
      LDSHFLAGS = -shared -Wl,-Bsymbolic 
-Wl,-rpath,/usr/local/cups/lib -L/usr/local/cups/lib
      LDFLAGS = -Wl,-rpath,/usr/local/cups/lib -L/usr/local/cups/lib
Compiling dynconfig.c
/tmp/ccCFZ026.s: Assembler messages:
/tmp/ccCFZ026.s:44: Error: suffix or operands invalid for `mov'
/tmp/ccCFZ026.s:97: Error: suffix or operands invalid for `mov'
make: *** [dynconfig.o] Error 1


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2004-11-12 09:08:55 UTC
1) do you really mean ia64?  There is no FC3/ia64, it would need to be either Fedora development tree or you mean FC3/x86-64
2) samba 3.0.8 builds just fine here, on all arches

Can you please convince samba in your build that it instead of printing
Compiling dynconfig.c prints the full gcc command line used to compile that
file and attach here preprocessed dynconfig.i (add -save-temps to the gcc options and rerun)?
Very likely this is a configuration problem and you are using say i386 inline
asm in x86-64 build or something like that.



Comment 2 Thomas M Steenholdt 2004-11-16 13:36:58 UTC
I'm seeing the same thing on my FC3 x86_64 (Intel EMT64)

Wether i choose to build samba from source or src.rpm i get this
problem. I've tried with gcc(3.4.2-6.fc3) gcc33(3.3.4-2),
gcc4(4.0.0-0.8) and the results are the same...

it looks as if the as assembler chokes on the assembly that gcc
generates for the dynconfig.c file.

Take a look at the attached files

seems like the most probable source of problems is with the as
assembler interpreting the code.

Comment 3 Thomas M Steenholdt 2004-11-16 13:38:32 UTC
Created attachment 106801 [details]
the error as shown by make on a vanilla samba (-save-temps added)

Comment 4 Thomas M Steenholdt 2004-11-16 13:39:25 UTC
Created attachment 106802 [details]
the asm code that as chokes on

Comment 5 Jakub Jelinek 2004-11-16 13:46:50 UTC
Can you attach dynconfig.i too?
My guess is this is a samba bug, my guess is it is using something like:
void *ptr;
...
asm volatile ("movl %0, %eax; ..." : : "r" (ptr) ...);
which is obviously incorrect for x86-64 (ptr is 64-bit, so you end up with
movl %rsi, %eax in the assembly you attached, but that is incorrect instruction).

Comment 6 Thomas M Steenholdt 2004-11-16 13:59:27 UTC
my initial thought was that the binutils package included in FC3 was
somehow corrupt for x86_64. I tried to update it to latest development
release with no luck. I've tried to downgrade it to FC2 level (never
tried FC2 on x86_64 so i'm not sure if that should work) with no luck.

this is what i've seen! Hope you guys can make som sense out of all of
this!

Comment 7 Thomas M Steenholdt 2004-11-16 14:00:17 UTC
Created attachment 106803 [details]
dynconfig.i

Comment 8 Thomas M Steenholdt 2004-11-16 14:06:41 UTC
i don't believe this is a samba bug... i've already discussed this
with samba team and they rebuilt it (from source) with no problem on
another distro!

Comment 9 Thomas M Steenholdt 2004-11-16 14:07:36 UTC
(on x86_64 as well of course)

logs are available here

http://build.samba.org/build.pl?function=View+Build;host=opi;tree=samba_3_0;compiler=gcc

Comment 10 Jakub Jelinek 2004-11-16 14:11:03 UTC
Ok, this seems like a bug in samba and valgrind.
Samba stupidly includes valgrind.h whenever that header exists (it should include
it only when --enable-developer when it is going to use it, as already including
that header means compiling some code in each .c file that #includes valgrind.h.

And the bug on valgrind side is that it should probably act as if NVALGRIND is
defined if not compiling 32-bit code.

Comment 11 Thomas M Steenholdt 2004-11-16 17:37:11 UTC
Well spotted!

I'll try to do some testing later on, removing tha valgrind header and
see if that changes anything! I may not be able to get around to it
until tomorrow but i'll keep you posted!

Comment 12 Thomas M Steenholdt 2004-11-16 21:46:03 UTC
removing valgrind and retrying does the trick!

Comment 13 Jakub Jelinek 2004-11-17 10:02:43 UTC
valgrind-2.2.0-6 should show up in rawhide today.

Comment 14 Thomas M Steenholdt 2004-11-19 08:43:40 UTC
installed latest version of valgrind and rebuilt samba. Problem is solved!

Thanks a lot!

Comment 15 Nerijus Baliūnas 2005-04-28 01:33:48 UTC
I also cannot recompile samba on FC3 x86_64, could you please issue an upgrade 
to valgrind for FC3? 


Note You need to log in before you can comment on or make changes to this bug.