Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a0a2ef5a
Commit
a0a2ef5a
authored
Oct 01, 2023
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: Initial ARM64EC target support.
parent
5004e6bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
11 deletions
+57
-11
tools.h
tools/tools.h
+9
-5
build.h
tools/winebuild/build.h
+1
-1
import.c
tools/winebuild/import.c
+36
-4
spec32.c
tools/winebuild/spec32.c
+7
-0
winegcc.c
tools/winegcc/winegcc.c
+4
-1
No files found.
tools/tools.h
View file @
a0a2ef5a
...
...
@@ -90,7 +90,7 @@ extern char **environ;
struct
target
{
enum
{
CPU_i386
,
CPU_x86_64
,
CPU_ARM
,
CPU_ARM64
}
cpu
;
enum
{
CPU_i386
,
CPU_x86_64
,
CPU_ARM
,
CPU_ARM64
,
CPU_ARM64EC
}
cpu
;
enum
{
...
...
@@ -481,6 +481,7 @@ static inline unsigned int get_target_ptr_size( struct target target )
[
CPU_x86_64
]
=
8
,
[
CPU_ARM
]
=
4
,
[
CPU_ARM64
]
=
8
,
[
CPU_ARM64EC
]
=
8
,
};
return
sizes
[
target
.
cpu
];
}
...
...
@@ -500,6 +501,7 @@ static inline void set_target_ptr_size( struct target *target, unsigned int size
if
(
size
==
8
)
target
->
cpu
=
CPU_ARM64
;
break
;
case
CPU_ARM64
:
case
CPU_ARM64EC
:
if
(
size
==
4
)
target
->
cpu
=
CPU_ARM
;
break
;
}
...
...
@@ -522,6 +524,7 @@ static inline int get_cpu_from_name( const char *name )
{
"x86_64"
,
CPU_x86_64
},
{
"amd64"
,
CPU_x86_64
},
{
"aarch64"
,
CPU_ARM64
},
{
"arm64ec"
,
CPU_ARM64EC
},
{
"arm64"
,
CPU_ARM64
},
{
"arm"
,
CPU_ARM
},
};
...
...
@@ -566,10 +569,11 @@ static inline const char *get_arch_dir( struct target target )
{
static
const
char
*
cpu_names
[]
=
{
[
CPU_i386
]
=
"i386"
,
[
CPU_x86_64
]
=
"x86_64"
,
[
CPU_ARM
]
=
"arm"
,
[
CPU_ARM64
]
=
"aarch64"
[
CPU_i386
]
=
"i386"
,
[
CPU_x86_64
]
=
"x86_64"
,
[
CPU_ARM
]
=
"arm"
,
[
CPU_ARM64
]
=
"aarch64"
,
[
CPU_ARM64EC
]
=
"arm64ec"
,
};
if
(
!
cpu_names
[
target
.
cpu
])
return
""
;
...
...
tools/winebuild/build.h
View file @
a0a2ef5a
...
...
@@ -192,7 +192,7 @@ static inline int is_pe(void)
#define FLAG_CPU(cpu) (0x10000 << (cpu))
#define FLAG_CPU_MASK (FLAG_CPU_WIN32 | FLAG_CPU_WIN64)
#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM64))
#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM64)
| FLAG_CPU(CPU_ARM64EC)
)
#define FLAG_CPU_WIN32 (FLAG_CPU(CPU_i386) | FLAG_CPU(CPU_ARM))
#define MAX_ORDINALS 65535
...
...
tools/winebuild/import.c
View file @
a0a2ef5a
...
...
@@ -802,6 +802,9 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"
\t
ldr x16, [x16, #%u]
\n
"
,
pos
&
0x7fff
);
output
(
"
\t
br x16
\n
"
);
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
output_function_size
(
name
);
}
...
...
@@ -1121,6 +1124,9 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
ldp x29, x30, [sp],#80
\n
"
);
output
(
"
\t
br x16
\n
"
);
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
output_cfi
(
".cfi_endproc"
);
output_function_size
(
module_func
);
...
...
@@ -1170,6 +1176,9 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
if
(
iat_pos
)
output
(
"
\t
add x16, x16, #%u
\n
"
,
iat_pos
);
output
(
"
\t
b %s
\n
"
,
asm_name
(
module_func
)
);
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
iat_pos
+=
get_ptr_size
();
}
...
...
@@ -1337,6 +1346,7 @@ void output_stubs( DLLSPEC *spec )
}
break
;
case
CPU_ARM64
:
case
CPU_ARM64EC
:
output_seh
(
".seh_proc %s"
,
asm_name
(
name
)
);
output_seh
(
".seh_endprologue"
);
output
(
"
\t
adrp x0, %s
\n
"
,
arm64_page
(
".L__wine_spec_file_name"
)
);
...
...
@@ -1353,8 +1363,6 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
b %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output_seh
(
".seh_endproc"
);
break
;
default:
assert
(
0
);
}
output_function_size
(
name
);
}
...
...
@@ -1467,6 +1475,7 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
bx lr
\n
"
);
break
;
case
CPU_ARM64
:
case
CPU_ARM64EC
:
output_seh
(
".seh_proc %s"
,
asm_name
(
name
)
);
output_seh
(
".seh_endprologue"
);
output
(
"
\t
mov x8, #%u
\n
"
,
id
);
...
...
@@ -1478,8 +1487,6 @@ void output_syscalls( DLLSPEC *spec )
output
(
"1:
\t
.quad %s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output_seh
(
".seh_endproc"
);
break
;
default:
assert
(
0
);
}
output_function_size
(
name
);
}
...
...
@@ -1561,6 +1568,20 @@ static void assemble_files( const char *prefix )
}
}
static
const
char
*
get_target_machine
(
void
)
{
static
const
char
*
machine_names
[]
=
{
[
CPU_i386
]
=
"x86"
,
[
CPU_x86_64
]
=
"x64"
,
[
CPU_ARM
]
=
"arm"
,
[
CPU_ARM64
]
=
"arm64"
,
[
CPU_ARM64EC
]
=
"arm64ec"
,
};
return
machine_names
[
target
.
cpu
];
}
/* build a library from the current asm files and any additional object files in argv */
void
output_static_lib
(
const
char
*
output_name
,
struct
strarray
files
,
int
create
)
{
...
...
@@ -1576,6 +1597,7 @@ void output_static_lib( const char *output_name, struct strarray files, int crea
{
args
=
find_link_tool
();
strarray_add
(
&
args
,
"/lib"
);
strarray_add
(
&
args
,
strmake
(
"-machine:%s"
,
get_target_machine
()
));
strarray_add
(
&
args
,
strmake
(
"-out:%s"
,
output_name
));
}
strarray_addall
(
&
args
,
as_files
);
...
...
@@ -1628,6 +1650,10 @@ static void build_dlltool_import_lib( const char *lib_name, DLLSPEC *spec, struc
strarray_add
(
&
args
,
"-m"
);
strarray_add
(
&
args
,
"arm64"
);
break
;
case
CPU_ARM64EC
:
strarray_add
(
&
args
,
"-m"
);
strarray_add
(
&
args
,
"arm64ec"
);
break
;
default:
break
;
}
...
...
@@ -1735,6 +1761,9 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
output
(
"
\t
br x16
\n
"
);
output_seh
(
".seh_endproc"
);
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
output_function_size
(
delay_load
);
output_gnu_stack_note
();
...
...
@@ -1878,6 +1907,9 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
output
(
"
\t
b %s
\n
"
,
asm_name
(
delay_load
)
);
}
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
output
(
"
\n\t
.section .idata$4
\n
"
);
...
...
tools/winebuild/spec32.c
View file @
a0a2ef5a
...
...
@@ -98,6 +98,8 @@ static int has_relays( DLLSPEC *spec )
{
int
i
;
if
(
target
.
cpu
==
CPU_ARM64EC
)
return
0
;
for
(
i
=
spec
->
base
;
i
<=
spec
->
limit
;
i
++
)
{
ORDDEF
*
odp
=
spec
->
ordinals
[
i
];
...
...
@@ -652,6 +654,9 @@ void output_module( DLLSPEC *spec )
output
(
"
\n\t
.section
\"
.init
\"
,
\"
ax
\"\n
"
);
output
(
"
\t
b 1f
\n
"
);
break
;
case
CPU_ARM64EC
:
assert
(
0
);
break
;
}
output
(
"__wine_spec_pe_header:
\n
"
);
output
(
"
\t
.skip %u
\n
"
,
65536
+
page_size
);
...
...
@@ -671,6 +676,7 @@ void output_module( DLLSPEC *spec )
switch
(
target
.
cpu
)
{
case
CPU_i386
:
machine
=
IMAGE_FILE_MACHINE_I386
;
break
;
case
CPU_ARM64EC
:
case
CPU_x86_64
:
machine
=
IMAGE_FILE_MACHINE_AMD64
;
break
;
case
CPU_ARM
:
machine
=
IMAGE_FILE_MACHINE_ARMNT
;
break
;
case
CPU_ARM64
:
machine
=
IMAGE_FILE_MACHINE_ARM64
;
break
;
...
...
@@ -1089,6 +1095,7 @@ static void output_pe_file( DLLSPEC *spec, const char signature[32] )
switch
(
target
.
cpu
)
{
case
CPU_i386
:
put_word
(
IMAGE_FILE_MACHINE_I386
);
break
;
case
CPU_ARM64EC
:
case
CPU_x86_64
:
put_word
(
IMAGE_FILE_MACHINE_AMD64
);
break
;
case
CPU_ARM
:
put_word
(
IMAGE_FILE_MACHINE_ARMNT
);
break
;
case
CPU_ARM64
:
put_word
(
IMAGE_FILE_MACHINE_ARM64
);
break
;
...
...
tools/winegcc/winegcc.c
View file @
a0a2ef5a
...
...
@@ -505,8 +505,9 @@ static const char *get_multiarch_dir( struct target target )
case
CPU_x86_64
:
return
"/x86_64-linux-gnu"
;
case
CPU_ARM
:
return
"/arm-linux-gnueabi"
;
case
CPU_ARM64
:
return
"/aarch64-linux-gnu"
;
default:
assert
(
0
);
}
assert
(
0
);
return
NULL
;
}
...
...
@@ -700,6 +701,8 @@ static void compile(struct options* opts, const char* lang)
strarray_add
(
&
comp_args
,
"-D__cdecl=__stdcall"
);
strarray_add
(
&
comp_args
,
"-D__fastcall=__stdcall"
);
break
;
case
CPU_ARM64EC
:
break
;
}
strarray_add
(
&
comp_args
,
"-D_stdcall=__stdcall"
);
strarray_add
(
&
comp_args
,
"-D_cdecl=__cdecl"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment