Bug 138923 - gcc problem compiling samba-3.0.8
gcc problem compiling samba-3.0.8
Product: Fedora
Classification: Fedora
Component: valgrind (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2004-11-11 17:50 EST by shane_drinkwater
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-17 05:02:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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 08:38 EST, Thomas M Steenholdt
no flags Details
the asm code that as chokes on (4.75 KB, text/plain)
2004-11-16 08:39 EST, Thomas M Steenholdt
no flags Details
dynconfig.i (857.69 KB, text/plain)
2004-11-16 09:00 EST, Thomas M Steenholdt
no flags Details

  None (edit)
Description shane_drinkwater 2004-11-11 17:50:25 EST
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
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/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 04:08:55 EST
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 08:36:58 EST
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 08:38:32 EST
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 08:39:25 EST
Created attachment 106802 [details]
the asm code that as chokes on
Comment 5 Jakub Jelinek 2004-11-16 08:46:50 EST
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 08:59:27 EST
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
Comment 7 Thomas M Steenholdt 2004-11-16 09:00:17 EST
Created attachment 106803 [details]
Comment 8 Thomas M Steenholdt 2004-11-16 09:06:41 EST
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 09:07:36 EST
(on x86_64 as well of course)

logs are available here

Comment 10 Jakub Jelinek 2004-11-16 09:11:03 EST
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 12:37:11 EST
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 16:46:03 EST
removing valgrind and retrying does the trick!
Comment 13 Jakub Jelinek 2004-11-17 05:02:43 EST
valgrind-2.2.0-6 should show up in rawhide today.
Comment 14 Thomas M Steenholdt 2004-11-19 03:43:40 EST
installed latest version of valgrind and rebuilt samba. Problem is solved!

Thanks a lot!
Comment 15 Nerijus Baliūnas 2005-04-27 21:33:48 EDT
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.