Opened 16 years ago

Closed 11 years ago

Last modified 11 years ago

#15496 closed defect (wontfix)

llvm +universal doesn't build

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: erickt@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: smokris (Steve Mokris)
Port: llvm

Description

Building a universal variant of llvm doesn't seem to work:

$ sudo port install llvm +universal
--->  Fetching llvm
--->  Verifying checksum(s) for llvm
--->  Extracting llvm
--->  Configuring llvm
--->  Building llvm with target tools-only
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build" && nice -n 1 make tools-only " returned error 2
Command output: llvm[2]: Compiling TableGen.cpp for Release build 
llvm[2]: Compiling TableGenBackend.cpp for Release build 
llvm[2]: Linking Release executable tblgen (without symbols)
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/AsmWriterEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/CallingConvEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/CodeEmitterGen.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/CodeGenDAGPatterns.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/CodeGenInstruction.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/CodeGenTarget.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/DAGISelEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/InstrEnumEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/InstrInfoEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/IntrinsicEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/Record.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/RegisterInfoEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/SubtargetEmitter.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/TGLexer.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/TGParser.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/TableGen.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/utils/TableGen/Release/TableGenBackend.o cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/Release/lib/libLLVMSupport.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/Release/lib/libLLVMSystem.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc9jNQ2x.out (No such file or directory)
make[2]: *** [/opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build/Release/bin/tblgen] Error 1
make[1]: *** [TableGen/.makeall] Error 2
make: *** [all] Error 1

Error: Status 1 encountered during processing.
$

Attachments (2)

llvm-universal.diff (1010 bytes) - added by ryandesign (Ryan Carsten Schmidt) 15 years ago.
in progress attempt to make llvm universal
llvm-universal.2.diff (794 bytes) - added by ryandesign (Ryan Carsten Schmidt) 13 years ago.
new unfinished patch

Download all attachments as: .zip

Change History (11)

comment:1 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:2 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Port: llvm added

I disabled the universal variant for now in r56930. If you can figure out how to make it work, please reenable.

Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: llvm-universal.diff added

in progress attempt to make llvm universal

comment:3 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Using the attached patch using the muniversal portgroup gets close to allowing a universal build, but the llvm-config program differs between architectures, and I don't know how to resolve it.

$ diff -ru work/destroot-{i386,x86_64}/opt/local/bin/llvm-config 
--- work/destroot-i386/opt/local/bin/llvm-config	2009-12-01 17:13:20.000000000 -0600
+++ work/destroot-x86_64/opt/local/bin/llvm-config	2009-12-01 17:12:47.000000000 -0600
@@ -23,9 +23,9 @@
 my $PACKAGE_NAME        = q{llvm};
 my $VERSION             = q{2.6};
 my $PREFIX              = q{/opt/local};
-my $LLVM_CONFIGTIME     = q{Tue Dec  1 16:32:20 CST 2009};
+my $LLVM_CONFIGTIME     = q{Tue Dec  1 16:31:22 CST 2009};
 my $LLVM_SRC_ROOT       = q{/opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/llvm-2.6};
-my $LLVM_OBJ_ROOT       = q{/opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build-i386};
+my $LLVM_OBJ_ROOT       = q{/opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_llvm/work/build-x86_64};
 my $LLVM_ON_WIN32       = q{0};
 my $LLVM_ON_UNIX        = q{1};
 my $LLVMGCCDIR          = q{};
@@ -37,8 +37,8 @@
 my $SHLIBEXT            = q{.dylib};
 my $EXEEXT              = q{};
 my $OS                  = q{Darwin};
-my $ARCH                = lc(q{x86});
-my $TARGET_TRIPLE       = q{i386-apple-darwin10};
+my $ARCH                = lc(q{x86_64});
+my $TARGET_TRIPLE       = q{x86_64-apple-darwin10};
 my $TARGETS_TO_BUILD    = q{X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend};
 my $TARGET_HAS_JIT      = q{1};
 my @TARGETS_BUILT       = map { lc($_) } qw{X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend};

comment:4 Changed 15 years ago by israfel33@…

Following seems to work:

port configure llvm
cd `port dir llvm`
cd work/build
sudo make UNIVERSAL=yes UNIVERSAL_ARCH="i386 x86_64"
sudo make install

Do not know how to do this using configure flags :-(

comment:5 Changed 14 years ago by smokris (Steve Mokris)

Cc: smokris@… added

Cc Me!

comment:6 in reply to:  4 ; Changed 14 years ago by smokris (Steve Mokris)

israfel33@…'s instructions above aren't working for me (perhaps something has changed in the year that's elapsed since that comment). It builds for about an hour, then says:

make[2]: *** No rule to make target `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/llvm-2.8/Release/lib/libLLVM-2.8.dylib', needed by `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/llvm-2.8/Release/bin/opt'.  Stop.

(I'm not sure offhand how to further troubleshoot this.)

comment:7 in reply to:  6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to israfel33@…:

sudo make UNIVERSAL=yes UNIVERSAL_ARCH="i386 x86_64"

Yes, this seems to be how Homebrew is doing it now and how macruby recommends compiling it.

Replying to smokris@…:

make[2]: *** No rule to make target `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/llvm-2.8/Release/lib/libLLVM-2.8.dylib', needed by `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_llvm/work/llvm-2.8/Release/bin/opt'.  Stop.

Yes, this seems to be reported in llvm's issue tracker as well. I get it too.

I'll attach a patch of my new update attempt so far.

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: llvm-universal.2.diff added

new unfinished patch

comment:8 Changed 11 years ago by larryv (Lawrence Velázquez)

Resolution: wontfix
Status: newclosed

Assuming this is no longer relevant. We don’t even have an llvm port anymore.

comment:9 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Indeed:

$ port installed | grep llvm-
  llvm-2.9 @2.9_13+universal (active)
  llvm-3.0 @3.0_12+universal (active)
  llvm-3.1 @3.1_7+universal (active)
  llvm-3.2 @3.2_1+universal (active)
  llvm-3.3 @3.3_0+universal (active)
  llvm-gcc42 @2336.11_1+universal (active)
Note: See TracTickets for help on using tickets.