Dale Johannesen
2009-Mar-12 17:08 UTC
[LLVMdev] Consumer ARM platform suitable for LLVM development?
On Mar 12, 2009, at 8:30 AMPDT, Misha Brukman wrote:> > ../../../../src/llvm-gcc4.2-2.5.source/gcc/config/arm/arm.md:4788: > error: ‘MACHO_DYNAMIC_NO_PIC_P’ undeclared here (not in a function) > > This tells me there are some Darwin-specific bits in arm.md which > shouldn't be there (MachO is Mac OS X-specific). I'm using the > attached script llvm-arm-crosstool.sh to configure/build/install > LLVM and LLVM-GCC from the 2.5 release. If anyone wants to try it > out and see if it works for them, I'd love to hear their experiences. > > If any ARM/GCC experts know how to fix arm.md to not refer to Darwin- > specific macros, that would be great, too.Probably the right general idea is to #define MACHO_DYNAMIC_NO_PIC_P to be 0 for non-Darwin targets. Not sure where to put this so it will work for both targets (the Darwin definition comes from config/ darwin.h). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090312/ccdae5d1/attachment.html>
Anton Korobeynikov
2009-Mar-12 17:31 UTC
[LLVMdev] Consumer ARM platform suitable for LLVM development?
>> >> If any ARM/GCC experts know how to fix arm.md to not refer to >> Darwin-specific macros, that would be great, too. > > Probably the right general idea is to #define MACHO_DYNAMIC_NO_PIC_P > to be 0 for non-Darwin targets. Not sure where to put this so it > will work for both targets (the Darwin definition comes from config/ > darwin.h).I don't think so. Darwin-specific pieces of code should be guarded, as usual, with TARGET_MACHO define. --- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090312/e56f1cd6/attachment.html>
Misha Brukman
2009-Mar-12 19:05 UTC
[LLVMdev] Consumer ARM platform suitable for LLVM development?
On Thu, Mar 12, 2009 at 1:31 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote:> If any ARM/GCC experts know how to fix arm.md to not refer to > Darwin-specific macros, that would be great, too. > > Probably the right general idea is to #define MACHO_DYNAMIC_NO_PIC_P to be > 0 for non-Darwin targets. Not sure where to put this so it will work for > both targets (the Darwin definition comes from config/darwin.h). > > I don't think so. Darwin-specific pieces of code should be guarded, as > usual, with TARGET_MACHO define. >Perhaps, but the problem is that MACHO_DYNAMIC_NO_PIC_P is so ingrained into the machine description, that if you try to guard each use with something like #ifdef TARGET_MACHO ... #endif you will get unreadable code for something as simple as: ; APPLE LOCAL begin ARM pic support (define_insn "pic_load_addr_arm" [(set (match_operand:SI 0 "s_register_operand" "=r") (unspec:SI [(match_operand:SI 1 "" "mX") (label_ref (match_operand 2 "" ""))] UNSPEC_PIC_SYM)) (use (label_ref (match_dup 2)))] "TARGET_ARM && (flag_pic || (TARGET_MACHO && MACHO_DYNAMIC_NO_PIC_P))" "ldr%?\\t%0, %1" [(set_attr "type" "load1") (set (attr "pool_range") (const_int 4096)) (set (attr "neg_pool_range") (const_int 4084))] ) or, even more complex code sequence: ;; APPLE LOCAL begin compact switch tables ;; This pattern represents the library call for Thumb switch tables. ;; The functions' (sparse) register usage is recorded as clobbers. (define_insn "thumb_casesi_internal" [(parallel [(set (pc) (if_then_else (leu (match_operand:SI 0 "s_register_operand" "l") (match_operand:SI 1 "const_int_operand" "i")) (mem:SI (plus:SI (mult:SI (match_dup 0) (const_int 2)) (label_ref (match_operand 2 "" "")))) (label_ref (match_operand 3 "" "")))) (clobber (reg:CC CC_REGNUM)) (clobber (reg:SI LR_REGNUM)) (clobber (reg:SI IP_REGNUM)) (use (reg:SI 0)) (use (label_ref (match_dup 2)))])] "TARGET_COMPACT_SWITCH_TABLES" "* { rtx body = PATTERN (next_real_insn (insn)); static char buf[255]; gcc_assert (GET_CODE (body) == ADDR_DIFF_VEC); strcpy(buf, \"bl\\t\"); if (flag_pic || MACHO_DYNAMIC_NO_PIC_P) strcat(buf, \"L\"); if (GET_MODE (body) == QImode && ADDR_DIFF_VEC_FLAGS (body).offset_unsigned) { register_switchu8_libfunc (); [... more code below ...] If this code is purely Darwin-specific, it shouldn't even appear in arm.md. If this is ARM-PIC-specific, then we should use a var such as ARM_PIC, and darwin.h can set the common ARM_PIC variable if MACHO_DYNAMIC_* is defined. Adding #ifdef/#endif code to .md files will make what's already barely readable even less comprehensible. Misha -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090312/44c717ee/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Consumer ARM platform suitable for LLVM development?
- [LLVMdev] Consumer ARM platform suitable for LLVM development?
- [LLVMdev] Consumer ARM platform suitable for LLVM development?
- [LLVMdev] Consumer ARM platform suitable for LLVM development?
- [LLVMdev] -fomit-frame-pointer on intel darwin