Building clang and llvm on OpenBSD 4.8+

Hello,

I just want to report that clang + llvm, sources grabbed from early
today built a Debug+Asserts just fine on OpenBSD -current AMD64 which
was itself built yesterday!

OpenBSD 4.8+ AMD64 system compiler is gcc/g++ 4.2.1

I had to following MINOR modifications to make it happen.

1) I just had to remove a line reproduced below @ around the end of
file in following files

local: *; ==> Offending line

which caused errors like
syntax error in VERSION script

This line is generated dynamically during the process of
compiling/linking in the following files

CLANG_BIN_DIR/tools/edis/Debug+Asserts/EnhancedDisassembly.exports.map
CLANG_BIN_DIR/tools/lto/Debug+Asserts/lto.exports.map
CLANG_BIN_DIR/tools/clang/tools/libclang/Debug+Asserts/libclang.exports.map
CLANG_BIN_DIR/runtime/libprofile/Debug+Asserts/libprofile.exports.map

For example, this is the original content of
CLANG_BIN_DIR/runtime/libprofile/Debug+Asserts/libprofile.exports.map

{
    llvm_start_edge_profiling;
    llvm_start_opt_edge_profiling;
    llvm_start_basic_block_tracing;
    llvm_trace_basic_block;
    local: *;
};

I did a grep in CLANG_BIN_DIR but surprisingly the following files
also have it but gcc doesn't complain in those instances.

# pwd
/extra/clang-build
# find . -name "*.map" | xargs grep local
./tools/bugpoint-passes/Debug+Asserts/bugpoint.exports.map: local: *;
./lib/Transforms/Hello/Debug+Asserts/Hello.exports.map: local: *;

Thank you thank you thank you!
P.S the build has lots and lots of warnings if anybody is interested I
will send it.

I just turned off the version scripts :slight_smile:

Does ENABLE_SHARED = 1 work on amd64 as well?

I did a svn up, will try out your changes.

I don't know! Trying out the release+asserts with enable shared.

Thanks

Hi,

I am @ revision 118197. I built clang like this
../llvm/configure --enable-optimized --enable-shared

I had to remove the local: *; from the same files in Release+Asserts
directory. I don't know why it didn't pick up the version script
changes. Anyway its minor.

CLANG_BIN_DIR/tools/lto/Release+Asserts/lto.exports.map
CLANG_BIN_DIR/tools/edis/Release+Asserts/EnhancedDisassembly.exports.map
CLANG_BIN_DIR/tools/clang/tools/libclang/Debug+Asserts/libclang.exports.map
CLANG_BIN_DIR/runtime/libprofile/Debug+Asserts/libprofile.exports.map

Clang builds with shared libs too.

clang went from 600 Megs down to 14 Megs when enable shared is turned on.

Thanks a lot!