g++ -x assembler-with-cpp under cygwin 64

jfrm.maurel@gmail.com jfrm.maurel@gmail.com
Thu Mar 27 13:52:00 GMT 2014


Hi,

Trying to build boost libraries I have following failure when issuing 
following command under cygwin 64 on Windows 7 (64bits 6Go RAM):

"g++" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall 
-DBOOST_ALL_NO_LIB=1 -DBOOST_CONTEXT_SOURCE -DNDEBUG -I"." -c -o 
"bin.v2/libs/context/build/gcc-4.8.2/release/link-static/asm/make_x86_64_sysv_elf_gas.o" 
"libs/context/src/asm/make_x86_64_sysv_elf_gas.S"

libs/context/src/asm/make_x86_64_sysv_elf_gas.S: Messages de l'assembleur:
libs/context/src/asm/make_x86_64_sysv_elf_gas.S:43: Avertissement: .type 
pseudo opérateur utilisé à l'extérieur de .def/.endef ignoré.
libs/context/src/asm/make_x86_64_sysv_elf_gas.S:43: Erreur: rebut à la 
fin de la ligne, premier caractère non reconnu est « m »
libs/context/src/asm/make_x86_64_sysv_elf_gas.S:73: Avertissement: .size 
pseudo opérateur utilisé à l'extérieur de .def/.endef ignoré.
libs/context/src/asm/make_x86_64_sysv_elf_gas.S:73: Erreur: rebut à la 
fin de la ligne, premier caractère non reconnu est « m »
libs/context/src/asm/make_x86_64_sysv_elf_gas.S:76: Erreur: rebut à la 
fin de la ligne, premier caractère non reconnu est « - »

Could you please tell me what I am doing wrong ?

Regards

assembler code (see attached file):
------------------------------------------------

/*
             Copyright Oliver Kowalke 2009.
    Distributed under the Boost Software License, Version 1.0.
       (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
     leaq   -0x58(%rdi),    %rax        /* reserve space for fcontext_t 
at top of context stack */

     /* shift address in RAX to lower 16 byte boundary */
     /* == pointer to fcontext_t and address of context stack */
     andq   $-16,           %rax

     movq   %rdi,           0x40(%rax) /* save address of context stack 
pointer (base) in fcontext_t */
     movq   %rsi,           0x48(%rax) /* save context stack size in 
fcontext_t */
     movq   %rdx,           0x38(%rax) /* save address of context 
function in fcontext_t */

     stmxcsr  0x50(%rax)                /* save MMX control and status 
word */
     fnstcw   0x54(%rax)                /* save x87 control word */

     leaq   -0x8(%rax),      %rdx       /* reserve space for the return 
address on context stack, (RSP - 0x8) % 16 == 0 */
     movq   %rdx,            0x30(%rax) /* save address in RDX as stack 
pointer for context function */

     leaq   finish(%rip),    %rcx       /* compute abs address of label 
finish */
     movq   %rcx,            (%rdx)     /* save address of finish as 
return address for context function */
                                        /* entered after context 
function returns */

     ret                                /* return pointer to fcontext_t 
placed on context stack */

finish:
     /* RSP points to same address as RSP on entry of context function + 
0x8 */
     xorq    %rdi,           %rdi       /* exit code is zero */
     call   _exit@PLT                   /* exit application */
     hlt
.size make_fcontext,.-make_fcontext

/* Mark that we don't need executable stack.  */
.section .note.GNU-stack,"",%progbits

-- 
Jean-François MAUREL
PIMECA
http://www.pimeca.com

-------------- next part --------------
/*
            Copyright Oliver Kowalke 2009.
   Distributed under the Boost Software License, Version 1.0.
      (See accompanying file LICENSE_1_0.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
*/

/****************************************************************************************
 *                                                                                      *
 *  ----------------------------------------------------------------------------------  *
 *  |    0    |    1    |    2    |    3    |    4     |    5    |    6    |    7    |  *
 *  ----------------------------------------------------------------------------------  *
 *  |   0x0   |   0x4   |   0x8   |   0xc   |   0x10   |   0x14  |   0x18  |   0x1c  |  *
 *  ----------------------------------------------------------------------------------  *
 *  |        RBX        |        R12        |         R13        |        R14        |  *
 *  ----------------------------------------------------------------------------------  *
 *  ----------------------------------------------------------------------------------  *
 *  |    8    |    9    |   10    |   11    |    12    |    13   |    14   |    15   |  *
 *  ----------------------------------------------------------------------------------  *
 *  |   0x20  |   0x24  |   0x28  |  0x2c   |   0x30   |   0x34  |   0x38  |   0x3c  |  *
 *  ----------------------------------------------------------------------------------  *
 *  |        R15        |        RBP        |         RSP        |        RIP        |  *
 *  ----------------------------------------------------------------------------------  *
 *  ----------------------------------------------------------------------------------  *
 *  |   16    |   17    |   18    |    19   |                                        |  *
 *  ----------------------------------------------------------------------------------  *
 *  |  0x40   |  0x44   |  0x48   |   0x4c  |                                        |  *
 *  ----------------------------------------------------------------------------------  *
 *  |        sp         |       size        |                                        |  *
 *  ----------------------------------------------------------------------------------  *
 *  ----------------------------------------------------------------------------------  *
 *  |    20   |    21   |                                                            |  *
 *  ----------------------------------------------------------------------------------  *
 *  |   0x50  |   0x54  |                                                            |  *
 *  ----------------------------------------------------------------------------------  *
 *  | fc_mxcsr|fc_x87_cw|                                                            |  *
 *  ----------------------------------------------------------------------------------  *
 *                                                                                      *
 * **************************************************************************************/

.text
.globl make_fcontext
.type make_fcontext,@function
.align 16
make_fcontext:
    leaq   -0x58(%rdi),    %rax        /* reserve space for fcontext_t at top of context stack */

    /* shift address in RAX to lower 16 byte boundary */
    /* == pointer to fcontext_t and address of context stack */
    andq   $-16,           %rax

    movq   %rdi,           0x40(%rax) /* save address of context stack pointer (base) in fcontext_t */
    movq   %rsi,           0x48(%rax) /* save context stack size in fcontext_t */
    movq   %rdx,           0x38(%rax) /* save address of context function in fcontext_t */

    stmxcsr  0x50(%rax)                /* save MMX control and status word */
    fnstcw   0x54(%rax)                /* save x87 control word */

    leaq   -0x8(%rax),      %rdx       /* reserve space for the return address on context stack, (RSP - 0x8) % 16 == 0 */
    movq   %rdx,            0x30(%rax) /* save address in RDX as stack pointer for context function */

    leaq   finish(%rip),    %rcx       /* compute abs address of label finish */
    movq   %rcx,            (%rdx)     /* save address of finish as return address for context function */
                                       /* entered after context function returns */

    ret                                /* return pointer to fcontext_t placed on context stack */

finish:
    /* RSP points to same address as RSP on entry of context function + 0x8 */
    xorq    %rdi,           %rdi       /* exit code is zero */
    call   _exit@PLT                   /* exit application */
    hlt
.size make_fcontext,.-make_fcontext

/* Mark that we don't need executable stack.  */
.section .note.GNU-stack,"",%progbits


More information about the Binutils mailing list