Skip to content

Commit

Permalink
fixes for mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
deanm1278 committed Aug 30, 2018
1 parent de69380 commit e4408a1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions binutils-gdb/gas/config/bfin-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct expression_cell
/* User Type Definitions. */
struct bfin_insn
{
unsigned long value;
unsigned long long value;
struct bfin_insn *next;
struct expression_cell *exp;
int pcrel;
Expand All @@ -258,7 +258,7 @@ struct bfin_insn

typedef struct expr_node_struct Expr_Node;

extern INSTR_T gencode (unsigned long x);
extern INSTR_T gencode (unsigned long long x);
extern INSTR_T conscode (INSTR_T head, INSTR_T tail);
extern INSTR_T conctcode (INSTR_T head, INSTR_T tail);
extern INSTR_T note_reloc
Expand Down
16 changes: 10 additions & 6 deletions binutils-gdb/gas/config/tc-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ note_reloc2 (INSTR_T code, const char *symbol, int reloc, int value, int pcrel)
}

INSTR_T
gencode (unsigned long x)
gencode (unsigned long long x)
{
INSTR_T cell = XOBNEW (&mempool, struct bfin_insn);
memset (cell, 0, sizeof (struct bfin_insn));
Expand Down Expand Up @@ -1171,6 +1171,10 @@ Expr_Node_Gen_Reloc_R (Expr_Node * head)
#define ASSIGNF(x,f) c_code.opcode |= ((x & c_code.mask_##f)<<c_code.bits_##f)
#define ASSIGN_R(x) c_code.opcode |= (((x ? (x->regno & CODE_MASK) : 0) & c_code.mask_##x)<<c_code.bits_##x)

#define ASSIGN64(x) c_code.opcode |= ((unsigned long long)(x & c_code.mask_##x)<<c_code.bits_##x)
#define ASSIGNF64(x,f) c_code.opcode |= ((unsigned long long)(x & c_code.mask_##f)<<c_code.bits_##f)
#define ASSIGN_R64(x) c_code.opcode |= ((unsigned long long)((x ? (x->regno & CODE_MASK) : 0) & c_code.mask_##x)<<c_code.bits_##x)

#define HI_64(x) (((unsigned long long)x >> 48) & 0xffff)
#define HI_MID_64(x) (((unsigned long long)x >> 32) & 0xffff)
#define LO_MID_64(x) (((unsigned long long)x >> 16) & 0xffff)
Expand Down Expand Up @@ -1384,17 +1388,17 @@ bfin_gen_linkage (int R, int framesize)
INSTR_T
bfin_gen_ldimm (REG_T reg, Expr_Node * pimm)
{
long int grp;
long int imm;
long long grp;
long long imm;
unsigned val = EXPR_VALUE (pimm);
INIT (LDIMM);

ASSIGN_R (reg);
ASSIGN_R64 (reg);
grp = (GROUP (reg));
ASSIGN (grp);
ASSIGN64 (grp);

imm = val;
ASSIGN (imm);
ASSIGN64 (imm);

return GEN_OPCODE64 ();
}
Expand Down
9 changes: 6 additions & 3 deletions buildscript/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ build_openocd()
echo "configuring openocd..."
run_cmd "${DIR_OPENOCD_SOURCE}"/configure --prefix=${prefix} $BUILD_TARGET $HOST_TARGET --disable-werror
echo "building openocd..."
run_cmd $MAKE LDFLAGS="-L/usr/local/lib"
#run_cmd $MAKE LDFLAGS="-L/usr/local/lib"

#this is hacky...
run_cmd $MAKE LDFLAGS="-L/mnt/c/msys64/mingw64/lib"
echo "installing openocd..."
run_cmd make install
}
Expand All @@ -124,7 +127,7 @@ build_gcc elf $DIR_ELF_OUTPUT
rm -rf ldr-utils_build
build_ldr_utils

#TODO: if it's for windows we also need libwinpthread-1.dll

mkdir openocd_build
build_openocd $DIR_ELF_OUTPUT

#TODO: if it's for windows we also need libwinpthread-1.dll and libusb1

0 comments on commit e4408a1

Please sign in to comment.