sashati / macfuse

Automatically exported from code.google.com/p/macfuse
Other
0 stars 0 forks source link

libfuse.dylib load command 4 unknown cmd field #382

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

while porting an own fs to my mac, I noticed a problem while linking the fs
against the libfuse:

edv027:~/Desktop/dtsmfs andreas$ ./compileme.sh mac
/usr/bin/ld: /usr/local/lib/libfuse.dylib load command 4 unknown cmd field
collect2: ld returned 1 exit status

My system:
Darwin edv027.medma.ad.uni-heidelberg.de 8.11.0 Darwin Kernel Version
8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
Power Macintosh powerpc

My compiling:
        gcc -D__FreeBSD__ -DMACOSX -I./fuse_h -D_FILE_OFFSET_BITS=64 -O2
-L/usr/local/lib -lfuse -o dtsmfs  dtsmfs.c

Any idea that I can get it compiling?

Greetings -- Andreas

Problem:

Load command 4
      cmd ?(0x0000001b) Unknown load command
  cmdsize 24

edv027:~/Desktop/dtsmfs andreas$ otool -l /usr/local/lib/libfuse.dylib
/usr/local/lib/libfuse.dylib:
Load command 0
      cmd LC_SEGMENT
  cmdsize 396
  segname __TEXT
   vmaddr 0x00000000
   vmsize 0x00014000
  fileoff 0
 filesize 81920
  maxprot 0x00000007
 initprot 0x00000005
   nsects 5
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x00000fa8
      size 0x0000f264
    offset 4008
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __picsymbolstub1
   segname __TEXT
      addr 0x0001020c
      size 0x00001ac0
    offset 66060
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 32 (size of stubs)
Section
  sectname __cstring
   segname __TEXT
      addr 0x00011ccc
      size 0x00002286
    offset 72908
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x00013f54
      size 0x0000006a
    offset 81748
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __literal8
   segname __TEXT
      addr 0x00013fc0
      size 0x00000040
    offset 81856
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000004
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_SEGMENT
  cmdsize 600
  segname __DATA
   vmaddr 0x00014000
   vmsize 0x00002000
  fileoff 81920
 filesize 4096
  maxprot 0x00000007
 initprot 0x00000003
   nsects 8
    flags 0x0
Section
  sectname __data
   segname __DATA
      addr 0x00014000
      size 0x0000045c
    offset 81920
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __dyld
   segname __DATA
      addr 0x0001445c
      size 0x00000008
    offset 83036
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x00014464
      size 0x00000358
    offset 83044
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 214 (index into indirect symbol table)
 reserved2 0
Section
  sectname __nl_symbol_ptr
   segname __DATA
      addr 0x000147bc
      size 0x0000001c
    offset 83900
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 428 (index into indirect symbol table)
 reserved2 0
Section
  sectname __const
   segname __DATA
      addr 0x000147d8
      size 0x000006d8
    offset 83928
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __mod_init_func
   segname __DATA
      addr 0x00014eb0
      size 0x00000008
    offset 85680
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000009
 reserved1 0
 reserved2 0
Section
  sectname __cfstring
   segname __DATA
      addr 0x00014eb8
      size 0x00000050
    offset 85688
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x00014f08
      size 0x00000418
    offset 0
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT
  cmdsize 56
  segname __LINKEDIT
   vmaddr 0x00016000
   vmsize 0x0000d000
  fileoff 86016
 filesize 51540
  maxprot 0x00000007
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 3
          cmd LC_ID_DYLIB
      cmdsize 56
         name /usr/local/lib/libfuse.0.dylib (offset 24)
   time stamp 1 Thu Jan  1 01:00:01 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 4
      cmd ?(0x0000001b) Unknown load command
  cmdsize 24
9fc9b17f 83eb37d9 0852e6e2 ae097a81
Load command 5
     cmd LC_SYMTAB
 cmdsize 24
  symoff 90568
   nsyms 2187
  stroff 120788
 strsize 16768
Load command 6
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 1937
     iextdefsym 1937
     nextdefsym 143
      iundefsym 2080
      nundefsym 107
         tocoff 118592
           ntoc 143
      modtaboff 119736
        nmodtab 1
   extrefsymoff 119788
    nextrefsyms 250
 indirectsymoff 116852
  nindirectsyms 435
      extreloff 116812
        nextrel 5
      locreloff 86016
        nlocrel 569
Load command 7
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 368.32.0
compatibility version 150.0.0
Load command 8
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libgcc_s.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1.0.0
compatibility version 1.0.0
Load command 9
          cmd LC_LOAD_DYLIB
      cmdsize 52
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 88.3.9
compatibility version 1.0.0

Original issue reported on code.google.com by abo...@gmx.de on 2 Sep 2008 at 5:53

GoogleCodeExporter commented 8 years ago
It would greatly help if you at least mention the version of MacFUSE you are 
using.

Secondly, *PLEASE* use http://groups.google.com/group/macfuse to discuss things 
and to get general help on 
using/developing with MacFUSE. Open a formal bug report (here) only if we have 
an actual bug in MacFUSE.

By the way, your compile command line should have -D__FreeBSD__=10 instead of 
just -D__FreeBSD__. 

Looks like you are using an old version of Apple's Developer Tools (Xcode). The 
"cmd (0x0000001b) Unknown load 
command" error means that the linker is not identifying the LC_UUID load 
command in the libfuse object file. There 
have been similar reports where Tiger(PowerPC) kernel extension binaries 
compiled with a newer version of Apple's 
Developer Tools failed to load on older systems, even though they should have. 
Search for "unknown cmd field" in this 
section after selecting "All Issues" to search.

So now apparently we have a similar issue with libfuse. Try upgrading to the 
newest Xcode for Tiger. You can download 
it for free from Apple's web site 
(http://developer.apple.com/technology/xcode.html). It should solve your 
problem. In 
the off chance that it doesn't, report back--in that case, libfuse will have to 
be recompiled with the -no_uuid linker 
option.

Original comment by si...@gmail.com on 2 Sep 2008 at 6:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
As I said earlier, you should try upgrading your Developer Tools and see if 
that fixes your problem. Although this 
is not a MacFUSE problem per se, it is annoying enough for developers/users 
that I'll remove the offending load 
command from libfuse in the Tiger version of the next MacFUSE release.

You can manually strip the command from the library too:

strip -S -arch ppc -no_uuid /usr/local/lib/libfuse.dylib

Original comment by si...@gmail.com on 2 Sep 2008 at 6:57

GoogleCodeExporter commented 8 years ago
Sorry for my problems with mac fuse. I am not a Mac developer like you - I only 
try
to port my filesystem ot this great macfuse project. I am running 1.7. 

Thanks for answering and helping me. 

I add -D__FreeBSD__=10. ok.

I did follow your comment: "Try upgrading to the newest Xcode for Tiger. You can
download it for free from Apple's web site
(http://developer.apple.com/technology/xcode.html)" - first I did subscribe to 
the
Apple developer and then i mentioned that Apple do only provides a Xcode for 
Leopard
- unfortunately I am using 10.4. Do you have the latest Xcode for 10.4? 

The "strip -S -arch ppc -no_uuid /usr/local/lib/libfuse.dylib" did not work on 
10.4.
or on my 10.4? 

[edv027:andreas/Desktop/dtsmfs] andreas# strip -S -arch ppc -no_uuid
/usr/local/lib/libfuse.dylib
strip: unrecognized option: -no_uuid
Usage: strip [-AnuSXx] [-] [-d filename] [-s filename] [-R filename] [-o 
output] file
[...] 

Greetings and best wishes

Andreas

Original comment by abo...@gmx.de on 2 Sep 2008 at 8:01

GoogleCodeExporter commented 8 years ago
Well, yes, you need a strip that understands no_uuid. So you'll need a newer 
Xcode, or a Leopard machine, or 
you can also compile strip yourself from source.

As for a newer Xcode for Tiger, try searching for "Xcode 2.5" -- I'd be 
surprised if Apple still doesn't have it up 
for download. For example:

https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundl
eID=19907

Original comment by si...@gmail.com on 2 Sep 2008 at 8:49

GoogleCodeExporter commented 8 years ago
*wow* you are right. I get the Xcode from
https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundl
eID=19907
 and did a "strip -S -arch ppc -no_uuid /usr/local/lib/libfuse.dylib" and live is
like a bowl of cherries :) Did work.
Thank your very much. 
Will you deliver the newer versions of mac fuse with a stripped lib?
Greetings -- Andreas

Original comment by abo...@gmx.de on 2 Sep 2008 at 12:41

GoogleCodeExporter commented 8 years ago
Thanks!  I met the same problem.  And I fixed it following singh's words. 

Original comment by shaohong...@gmail.com on 1 Apr 2010 at 5:57