using clang on unionfs on mac

I'm trying to use unionFS-FUSE with fuse4x, which is to overlay a writable directory onto a read-only source directory.
both the writable and the read-only source directory are on a real HFS+ case insensitive volume.

clang worked well but for one issue, it seems becoming case sensitive to header file includes. so
#include "Foo.h"
#include "foo.h" // assuming Foo.h has #pragma once

actually includes both copies. This doesn't occur if I compile on source directory directly.

My understanding is, whether the two files should be treated as one file or two different file is depend on the underlying file system case sensitiveness.
so I guess clang can determine underlying FS is case sensitive or not, can anyone explain how it determines this?

Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Mac OS X 10.8.2


clang doesn't directly query whether a filesystem is case-sensitive.
The way clang determines if two different names refer to the same file
is based on the inode returned by stat(). It's possible that your
FUSE filesystem is somehow messing up the invariant that each file has
a unique inode.


Thanks Eli, that's exactly the problem.
I found the libfuse by default overrides the inode id in stat with a sequential number, because the user fs might not implement it correctly. They offered an option -o use_ino to disable this override.

A side note worth mention, Fuse4x 1.9.2 seems ignore use_ino option, the osxfuse port works.


ÔÚ 2012-11-30£¬ÏÂÎç12:02£¬Eli Friedman <> дµÀ£º