Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8c2ad8e4
Commit
8c2ad8e4
authored
Feb 10, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Use lld-link for static libraries on msvc target.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2d6b0b67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
12 deletions
+45
-12
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+33
-12
utils.c
tools/winebuild/utils.c
+11
-0
No files found.
tools/winebuild/build.h
View file @
8c2ad8e4
...
...
@@ -264,6 +264,7 @@ extern void output_rva( const char *format, ... )
__attribute__
((
__format__
(
__printf__
,
1
,
2
)));
extern
void
spawn
(
struct
strarray
array
);
extern
struct
strarray
find_tool
(
const
char
*
name
,
const
char
*
const
*
names
);
extern
struct
strarray
find_link_tool
(
void
);
extern
struct
strarray
get_as_command
(
void
);
extern
struct
strarray
get_ld_command
(
void
);
extern
const
char
*
get_nm_command
(
void
);
...
...
tools/winebuild/import.c
View file @
8c2ad8e4
...
...
@@ -1838,23 +1838,36 @@ static void assemble_files( const char *prefix )
}
/* build a library from the current asm files and any additional object files in argv */
static
void
build_library
(
const
char
*
output_name
,
char
**
argv
,
int
create
)
static
void
build_library
(
const
char
*
output_name
,
char
**
argv
,
const
char
*
importlib
)
{
struct
strarray
args
=
find_tool
(
"ar"
,
NULL
)
;
struct
strarray
ranlib
=
find_tool
(
"ranlib"
,
NULL
)
;
int
create
=
!
importlib
||
importlib
!=
output_name
;
struct
strarray
args
;
strarray_add
(
&
args
,
create
?
"rc"
:
"r"
,
output_name
,
NULL
);
if
(
target_platform
!=
PLATFORM_WINDOWS
)
{
args
=
find_tool
(
"ar"
,
NULL
);
strarray_add
(
&
args
,
create
?
"rc"
:
"r"
,
output_name
,
importlib
,
NULL
);
}
else
{
args
=
find_link_tool
();
strarray_add
(
&
args
,
"/lib"
,
strmake
(
"-out:%s"
,
output_name
),
importlib
,
NULL
);
}
strarray_addall
(
&
args
,
as_files
);
strarray_addv
(
&
args
,
argv
);
if
(
create
)
unlink
(
output_name
);
spawn
(
args
);
strarray_add
(
&
ranlib
,
output_name
,
NULL
);
spawn
(
ranlib
);
if
(
target_platform
!=
PLATFORM_WINDOWS
)
{
struct
strarray
ranlib
=
find_tool
(
"ranlib"
,
NULL
);
strarray_add
(
&
ranlib
,
output_name
,
NULL
);
spawn
(
ranlib
);
}
}
/* create a Windows-style import library */
static
void
build_windows_import_lib
(
DLLSPEC
*
spec
)
static
void
build_windows_import_lib
(
const
char
*
lib_name
,
DLLSPEC
*
spec
)
{
struct
strarray
args
;
char
*
def_file
;
...
...
@@ -1887,8 +1900,9 @@ static void build_windows_import_lib( DLLSPEC *spec )
m_flag
=
NULL
;
break
;
}
strarray_add
(
&
args
,
"-k"
,
strendswith
(
output_file_name
,
".delay.a"
)
?
"-y"
:
"-l"
,
output_file_name
,
"-d"
,
def_file
,
NULL
);
strarray_add
(
&
args
,
"-k"
,
strendswith
(
lib_name
,
".delay.a"
)
?
"-y"
:
"-l"
,
lib_name
,
"-d"
,
def_file
,
NULL
);
if
(
m_flag
)
strarray_add
(
&
args
,
"-m"
,
m_flag
,
as_flags
,
NULL
);
spawn
(
args
);
...
...
@@ -1960,12 +1974,19 @@ void output_static_lib( DLLSPEC *spec, char **argv )
{
if
(
is_pe
())
{
if
(
spec
)
build_windows_import_lib
(
spec
);
if
(
argv
[
0
]
||
!
spec
)
build_library
(
output_file_name
,
argv
,
!
spec
);
const
char
*
importlib
=
NULL
;
if
(
spec
)
{
importlib
=
(
argv
[
0
]
&&
target_platform
==
PLATFORM_WINDOWS
)
?
get_temp_file_name
(
output_file_name
,
".a"
)
:
output_file_name
;
build_windows_import_lib
(
importlib
,
spec
);
}
if
(
argv
[
0
]
||
!
spec
)
build_library
(
output_file_name
,
argv
,
importlib
);
}
else
{
if
(
spec
)
build_unix_import_lib
(
spec
);
build_library
(
output_file_name
,
argv
,
1
);
build_library
(
output_file_name
,
argv
,
NULL
);
}
}
tools/winebuild/utils.c
View file @
8c2ad8e4
...
...
@@ -387,6 +387,17 @@ struct strarray find_tool( const char *name, const char * const *names )
fatal_error
(
"cannot find the '%s' tool
\n
"
,
name
);
}
/* find a link tool in the path */
struct
strarray
find_link_tool
(
void
)
{
struct
strarray
ret
=
empty_strarray
;
const
char
*
file
;
if
(
!
(
file
=
find_binary
(
NULL
,
"lld-link"
)))
fatal_error
(
"cannot find the 'lld-link tool
\n
"
);
strarray_add_one
(
&
ret
,
file
);
return
ret
;
}
struct
strarray
get_as_command
(
void
)
{
struct
strarray
args
;
...
...
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