.asm files vs. 4.4 Xcode

  • Hi Gang:

    I have been using XCode to compile the apple file lib1funcs.asm file.

    I only need two functions from it. Switch8 and Switch16.  These are the errors I get when trying to compile it on 4.4 (no errors on 4.3.3):

    /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:268:26: error: unexpected token in '.macro' directive
    .macro do_it cond, suffix=""
                            ^
    /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:269:6: error: unexpected '.endm' in file, no current macro definition
    .endm
        ^
    /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:151:2: error: invalid instruction
    ldrccsb r0, [lr, r0]
    ^
    /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:152:2: error: invalid instruction
    ldrcssb r0, [lr, ip]
    ^
    <instantiation>:8:1: error: invalid symbol redefinition
    ___$0:
    ^
    /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:1451:2: note: while in macro instantiation
    FUNC_START switch16
    ^
    /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:163:2: error: invalid instruction
    ldrccsh r0, [r0, #1]
    ^
    /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:165:2: error: invalid instruction
    ldrcssh r0, [ip, #1]
    ^

    It looks like changes to 1) the macro syntax, and 2) missing ldrccsb and ldrccsh instructions.  Nothing in Xcode release notes about assembler, assume it is now using a different compiler.  Tried switching the file type to both: Assembly and LLVL Assembly in the rightmost pane.  Looks like the default assembly language compiler has changed.  Any ideas on how to either 1) make this compile with the old compiler or 2) make changes to the lib1funcs.asm file to get it to compile with the existing compiler?

    Thanks for any responses.

    -Owen
  • On Aug 3, 2012, at 1:19 PM, Owen Hartnett <owen...> wrote:

    > Hi Gang:
    >
    > I have been using XCode to compile the apple file lib1funcs.asm file.
    >
    > I only need two functions from it. Switch8 and Switch16.  These are the errors I get when trying to compile it on 4.4 (no errors on 4.3.3):

    Hi Owen,

    Xcode 4.4 includes a brand new assembler built into the compiler.  This provides faster build times and has other advantages, but there are some minor things that it isn't compatible with.  Specifically, it only provides the "unified" syntax for ARM instructions.  You can get the old assembler with clang by passing the "-no-integrated-as" option to the compiler.

    Jim, what is the right unified syntax mnemonic for ldrccsb?  Is the .macro error a known-missing feature?

    -Chris

    >
    > /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:268:26: error: unexpected token in '.macro' directive
    > .macro do_it cond, suffix=""
    > ^
    > /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:269:6: error: unexpected '.endm' in file, no current macro definition
    > .endm
    > ^
    > /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:151:2: error: invalid instruction
    > ldrccsb r0, [lr, r0]
    > ^
    > /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:152:2: error: invalid instruction
    > ldrcssb r0, [lr, ip]
    > ^
    > <instantiation>:8:1: error: invalid symbol redefinition
    > ___$0:
    > ^
    > /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:1451:2: note: while in macro instantiation
    > FUNC_START switch16
    > ^
    > /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:163:2: error: invalid instruction
    > ldrccsh r0, [r0, #1]
    > ^
    > /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:165:2: error: invalid instruction
    > ldrcssh r0, [ip, #1]
    > ^
    >
    > It looks like changes to 1) the macro syntax, and 2) missing ldrccsb and ldrccsh instructions.  Nothing in Xcode release notes about assembler, assume it is now using a different compiler.  Tried switching the file type to both: Assembly and LLVL Assembly in the rightmost pane.  Looks like the default assembly language compiler has changed.  Any ideas on how to either 1) make this compile with the old compiler or 2) make changes to the lib1funcs.asm file to get it to compile with the existing compiler?
    >
    > Thanks for any responses.
    >
    > -Owen
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > https://lists.apple.com/mailman/options/xcode-users/<clattner...>
    >
    > This email sent to <clattner...>
  • On Aug 8, 2012, at 12:29 PM, Jim Grosbach wrote:

    >
    > On Aug 8, 2012, at 9:00 AM, Chris Lattner <clattner...> wrote:
    >
    >> On Aug 3, 2012, at 1:19 PM, Owen Hartnett <owen...> wrote:
    >>
    >>> Hi Gang:
    >>>
    >>> I have been using XCode to compile the apple file lib1funcs.asm file.
    >>>
    >>> I only need two functions from it. Switch8 and Switch16.  These are the errors I get when trying to compile it on 4.4 (no errors on 4.3.3):
    >>
    >> Hi Owen,
    >>
    >> Xcode 4.4 includes a brand new assembler built into the compiler.  This provides faster build times and has other advantages, but there are some minor things that it isn't compatible with.  Specifically, it only provides the "unified" syntax for ARM instructions.  You can get the old assembler with clang by passing the "-no-integrated-as" option to the compiler.
    >>
    >> Jim, what is the right unified syntax mnemonic for ldrccsb?
    >
    > The predicate comes after the size suffix in unified syntax, so "ldrsbcc".

    Thanks, Chris & Jim, for your replies.
    >
    >> Is the .macro error a known-missing feature?
    >
    > I haven't seen that macro error before. Do we have a radar for it?

    I wasn't aware it was a bug.  If you just try to compile the lib1funcs.asm file without the #includes at the bottom, you'll get it.
    >
    > Is this the lib1funcs.asm from the old libgcc implementation from the GCC 4.2 compiler, perhaps?

    Yes.

    > If so, I suggest using the implementations of switch8 and switch16 from compiler-rt instead. compiler-rt/lib/arm/switch8.S and compiler-rt/lib/arm/switch16.S. That code already works great with the new assembler and doesn't have the licensing issues that the libgcc files often have.

    Got it. Compiled it.  Linked it. Running it. Thanks!

    -Owen

    >
    > -Jim
    >
    >> -Chris
    >>
    >>>
    >>> /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:268:26: error: unexpected token in '.macro' directive
    >>> .macro do_it cond, suffix=""
    >>> ^
    >>> /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:269:6: error: unexpected '.endm' in file, no current macro definition
    >>> .endm
    >>> ^
    >>> /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:151:2: error: invalid instruction
    >>> ldrccsb r0, [lr, r0]
    >>> ^
    >>> /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:152:2: error: invalid instruction
    >>> ldrcssb r0, [lr, ip]
    >>> ^
    >>> <instantiation>:8:1: error: invalid symbol redefinition
    >>> ___$0:
    >>> ^
    >>> /loomis/branches/PaperTitleBar/In2/Libraries/lib1funcs.asm:1451:2: note: while in macro instantiation
    >>> FUNC_START switch16
    >>> ^
    >>> /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:163:2: error: invalid instruction
    >>> ldrccsh r0, [r0, #1]
    >>> ^
    >>> /var/folders/3c/6c2mgwg94kv2xnwf9p1v42jh0000gn/T/lib1funcs-Jq8epL.s:165:2: error: invalid instruction
    >>> ldrcssh r0, [ip, #1]
    >>> ^
    >>>
    >>> It looks like changes to 1) the macro syntax, and 2) missing ldrccsb and ldrccsh instructions.  Nothing in Xcode release notes about assembler, assume it is now using a different compiler.  Tried switching the file type to both: Assembly and LLVL Assembly in the rightmost pane.  Looks like the default assembly language compiler has changed.  Any ideas on how to either 1) make this compile with the old compiler or 2) make changes to the lib1funcs.asm file to get it to compile with the existing compiler?
    >>>
    >>> Thanks for any responses.
    >>>
    >>> -Owen
    >>> _______________________________________________
    >>> Do not post admin requests to the list. They will be ignored.
    >>> Xcode-users mailing list      (<Xcode-users...>)
    >>> Help/Unsubscribe/Update your Subscription:
    >>> https://lists.apple.com/mailman/options/xcode-users/<clattner...>
    >>>
    >>> This email sent to <clattner...>
    >>
    >
previous month august 2012 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today