[LLVMdev] FreeBSD Support In lib/System

Reid Spencer reid at x10sys.com
Wed Sep 1 08:26:23 PDT 2004


Jeff & others

A couple words on how lib/System works that might help you.

1. The configure script identifies the build host and puts it in the
    $build variable. We use  that to determine the basic kind of
platform
    and put it in a variable named $OS. The value  of $OS can be: Linux,
    FreeBSD, Interix, SunOS, Darwin, etc.

2. The platform name is used to create a link from
    $BUILD_OBJ_ROOT/lib/System/platform to 
    $BUILD_SRC_ROOT/lib/System/$OS

3. All the *.cpp files in lib/System may *only* contain absolutely
    pure/vanilla platform independent code and they will #include
    a file of the same name in the "platform" subdirectory. For
    example lib/System/Path.cpp #includes lib/System/platform/Path.cpp.
    Since "platform" is a link, it will go to
    lib/System/FreeBSD/Path.cpp on a FreeBSD system. This file then
    contains the FreeBSD specific implementation of Path.

4. The "Unix" directory is intended to contain common/shared portions
    of the implementation. It must contain only that code which is 
    guaranteed to work on all Unix platforms. Similarly for Win32
    directory (which has no implementation yet). As time goes on we'll
    create subdirectories under Unix to factor out common code by 
    the various standards: BSD, SUS, POSIX, SysV, etc.

Reid

On Wed, 2004-09-01 at 08:08, Jeff Cohen wrote:
> The mailing list appears down right now, so I'm forwarding my recent
> submissions to you directly.
> 
> =============================================================
> 
> My experiment to build as if Linux has failed:
> 
> gmake[1]: Entering directory `/usr/home/llvm/obj/tools/llvmc'
> Compiling ConfigLexer.cpp
> /usr/home/llvm/obj/../tools/llvmc/ConfigLexer.l: In function `
>    llvm::ConfigLexerTokens handleSubstitution(llvm::ConfigLexerTokens)':
> /usr/home/llvm/obj/../tools/llvmc/ConfigLexer.l:66: error: `assert' undeclared 
>    (first use this function)
> /usr/home/llvm/obj/../tools/llvmc/ConfigLexer.l:66: error: (Each undeclared 
>    identifier is reported only once for each function it appears in.)
> /usr/home/llvm/obj/../tools/llvmc/ConfigLexer.l: In function `
>    llvm::ConfigLexerTokens llvm::Configlex()':
> /usr/home/llvm/obj/../tools/llvmc/ConfigLexer.l:174: error: `assert' undeclared 
>    (first use this function)
> ConfigLexer.cpp: In function `int yy_get_next_buffer()':
> ConfigLexer.cpp:1314: error: `assert' undeclared (first use this function)
> ConfigLexer.cpp: In function `void yyunput(int, char*)':
> ConfigLexer.cpp:1533: error: `assert' undeclared (first use this function)
> ConfigLexer.cpp: In function `yy_buffer_state* Config_create_buffer(FILE*, int)
>    ':
> ConfigLexer.cpp:1689: error: `assert' undeclared (first use this function)
> ConfigLexer.cpp: In function `yy_buffer_state* Config_scan_buffer(char*, 
>    unsigned int)':
> ConfigLexer.cpp:1810: error: `assert' undeclared (first use this function)
> ConfigLexer.cpp: In function `yy_buffer_state* Config_scan_bytes(const char*, 
>    int)':
> ConfigLexer.cpp:1864: error: `assert' undeclared (first use this function)
> gmake[1]: *** [/usr/home/llvm/obj/tools/llvmc/Debug/ConfigLexer.lo] Error 1
> gmake[1]: Leaving directory `/usr/home/llvm/obj/tools/llvmc'
> gmake: *** [llvmc/.makeall] Error 2
> 
> What I don't understand is that the assert macro is used all over the
> place, so why is it undeclared only here?  It is declared in assert.h on
> FreeBSD, but there is not a single include for it I can find other than
> lib/System/Unix/Unix.h, and I'm not using "Unix" platform.
> 
> I'll start over and use Unix.  It won't be until Friday before I have
> results. 
> 
> =============================================================
> 
> I did an update, reran configure, and got:
> 
> config.status: linking ../lib/System/FreeBSD to lib/System/platform
> config.status: error: ../lib/System/FreeBSD: file not found
> 
> I assume I should just copy the files from the Unix directory?
> 
> =============================================================
> 
> Well, that didn't take long.  "Unix" doesn't work either:
> 
> gmake[2]: Entering directory `/usr/home/llvm/obj/utils/TableGen'
> Compiling AsmWriterEmitter.cpp
> Compiling CodeEmitterGen.cpp
> Compiling CodeGenTarget.cpp
> Compiling FileLexer.cpp
> Compiling FileParser.cpp
> Compiling InstrInfoEmitter.cpp
> Compiling InstrSelectorEmitter.cpp
> Compiling Record.cpp
> Compiling RegisterInfoEmitter.cpp
> Compiling TableGen.cpp
> Compiling TableGenBackend.cpp
> Linking tblgen debug executable (without symbols)
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o): In function `llvm::sys::Path::is_file() const':
> /usr/include/c++/3.3/bits/basic_string.h:889: undefined reference to `llvm::sys::Path::is_valid() const'
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o): In function `llvm::sys::Path::is_directory() const':
> /usr/include/c++/3.3/bits/basic_string.h:891: undefined reference to `llvm::sys::Path::is_valid() const'
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o): In function `llvm::sys::Path::Path(std::string)':
> /usr/home/llvm/obj/lib/System/platform/Path.cpp:32: undefined reference to `llvm::sys::Path::is_valid() const'
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o): In function `llvm::sys::Path::Path(std::string)':
> /usr/home/llvm/obj/lib/System/platform/Path.cpp:32: undefined reference to `llvm::sys::Path::is_valid() const'
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o): In function `llvm::sys::Path::set_directory(std::string const&)':
> /usr/home/llvm/obj/lib/System/platform/Path.cpp:131: undefined reference to `llvm::sys::Path::is_valid() const'
> /usr/home/llvm/obj/lib/Debug/libLLVMsystem.a(Path.o):/usr/home/llvm/obj/lib/System/platform/Path.cpp:148: more undefined references to `llvm::sys::Path::is_valid() const' follow
> gmake[2]: *** [/usr/home/llvm/obj/tools/Debug/tblgen] Error 1
> gmake[2]: Leaving directory `/usr/home/llvm/obj/utils/TableGen'
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040901/d0398925/attachment.sig>


More information about the llvm-dev mailing list