Peng Yu via llvm-dev
2019-Jan-25 13:05 UTC
[llvm-dev] How to generate .bc file using configure && make on Mac OS X?
Hi, I use the following commands to compile a GNU package to .bc files on Linux. ./configure CC=clang RANLIB=llvm-ranlib CFLAGS=-flto LDFLAGS=-Wl\,-plugin-opt=save-temps\ -flto\ -fuse-ld=gold make But since it uses ld.gold, it won't work on Mac OS X. Is there something equivalent that works on Mac OS X? Thanks. -- Regards, Peng
Alex Denisov via llvm-dev
2019-Jan-28 10:52 UTC
[llvm-dev] How to generate .bc file using configure && make on Mac OS X?
Hi Peng, On macOS you just omit the '-fuse-ld=gold' and it will work out of the box. Cheers, Alex.> On 25. Jan 2019, at 14:05, Peng Yu via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi, > > I use the following commands to compile a GNU package to .bc files on Linux. > > ./configure CC=clang RANLIB=llvm-ranlib CFLAGS=-flto > LDFLAGS=-Wl\,-plugin-opt=save-temps\ -flto\ -fuse-ld=gold > make > > But since it uses ld.gold, it won't work on Mac OS X. Is there > something equivalent that works on Mac OS X? Thanks. > > -- > Regards, > Peng > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- AlexDenisov Software Engineer, https://lowlevelbits.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: Message signed with OpenPGP URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190128/7bb85bd5/attachment.sig>
Peng Yu via llvm-dev
2019-Jan-28 14:09 UTC
[llvm-dev] How to generate .bc file using configure && make on Mac OS X?
> On macOS you just omit the '-fuse-ld=gold' and it will work out of the box.> > ./configure CC=clang RANLIB=llvm-ranlib CFLAGS=-flto > > LDFLAGS=-Wl\,-plugin-opt=save-temps\ -flto\ -fuse-ld=gold > > makeNo. It doesn't work on Mac OS by just omitting '-fuse-ld=gold'. $ ../../../extract/bash-5.0/configure CC=clang CXX=clang++ RANLIB=llvm-ranlib CFLAGS=-g\ -flto LDFLAGS=-Wl\,-plugin-opt=save-temps\ -flto checking build system type... x86_64-apple-darwin17.7.0 checking host system type... x86_64-apple-darwin17.7.0 Beginning configuration for bash-5.0-release for x86_64-apple-darwin17.7.0 checking for gcc... clang checking whether the C compiler works... no configure: error: in `/Users/pengy/homebake/work/bash/build/Linux/y': configure: error: C compiler cannot create executables See `config.log' for more details Here is the relevant content from config.log ===configure:3750: checking whether the C compiler works configure:3772: clang -g -flto -Wl,-plugin-opt=save-temps -flto conftest.c >&5 ld: unknown option: -plugin-opt=save-temps clang: error: linker command failed with exit code 1 (use -v to see invocation) configure:3776: $? = 1 configure:3814: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "bash" | #define PACKAGE_TARNAME "bash" | #define PACKAGE_VERSION "5.0-release" | #define PACKAGE_STRING "bash 5.0-release" | #define PACKAGE_BUGREPORT "bug-bash at gnu.org" | #define PACKAGE_URL "" | #define ALIAS 1 | #define PUSHD_AND_POPD 1 | #define RESTRICTED_SHELL 1 | #define PROCESS_SUBSTITUTION 1 | #define PROMPT_STRING_DECODE 1 | #define SELECT_COMMAND 1 | #define HELP_BUILTIN 1 | #define ARRAY_VARS 1 | #define DPAREN_ARITHMETIC 1 | #define BRACE_EXPANSION 1 | #define COMMAND_TIMING 1 | #define EXTENDED_GLOB 1 | #define EXTGLOB_DEFAULT 0 | #define COND_COMMAND 1 | #define COND_REGEXP 1 | #define COPROCESS_SUPPORT 1 | #define ARITH_FOR_COMMAND 1 | #define NETWORK_REDIRECTIONS 1 | #define PROGRAMMABLE_COMPLETION 1 | #define DEBUGGER 1 | #define CASEMOD_ATTRS 1 | #define CASEMOD_EXPANSIONS 1 | #define GLOBASCII_DEFAULT 1 | #define FUNCTION_IMPORT 1 | #define MEMSCRAMBLE 1 | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3819: error: in `/Users/pengy/homebake/work/bash/build/Linux/y': configure:3821: error: C compiler cannot create executables == -- Regards, Peng