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
618ac5f3
Commit
618ac5f3
authored
Jan 21, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Add support for -Wl,--entry argument.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3ad95e03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
winegcc.c
tools/winegcc/winegcc.c
+29
-16
No files found.
tools/winegcc/winegcc.c
View file @
618ac5f3
...
...
@@ -219,6 +219,7 @@ struct options
const
char
*
isysroot
;
const
char
*
lib_suffix
;
const
char
*
subsystem
;
const
char
*
entry_point
;
const
char
*
prelink
;
strarray
*
prefix
;
strarray
*
lib_dirs
;
...
...
@@ -439,16 +440,7 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
if
(
opts
->
unicode_app
)
strarray_add
(
flags
,
"-municode"
);
if
(
opts
->
nodefaultlibs
||
use_wine_crt
)
strarray_add
(
flags
,
"-nodefaultlibs"
);
if
(
opts
->
nostartfiles
||
use_wine_crt
)
strarray_add
(
flags
,
"-nostartfiles"
);
if
(
opts
->
subsystem
)
{
strarray_add
(
flags
,
strmake
(
"-Wl,--subsystem,%s"
,
opts
->
subsystem
));
if
(
!
strcmp
(
opts
->
subsystem
,
"native"
))
{
const
char
*
entry
=
opts
->
target_cpu
==
CPU_x86
?
"_DriverEntry@8"
:
"DriverEntry"
;
strarray_add
(
flags
,
strmake
(
"-Wl,--entry,%s"
,
entry
));
}
}
if
(
opts
->
subsystem
)
strarray_add
(
flags
,
strmake
(
"-Wl,--subsystem,%s"
,
opts
->
subsystem
));
strarray_add
(
flags
,
"-Wl,--nxcompat"
);
...
...
@@ -957,7 +949,7 @@ static void build(struct options* opts)
const
char
*
spec_o_name
,
*
libgcc
=
NULL
;
const
char
*
output_name
,
*
spec_file
,
*
lang
;
int
generate_app_loader
=
1
;
const
char
*
crt_lib
=
NULL
;
const
char
*
crt_lib
=
NULL
,
*
entry_point
=
NULL
;
int
fake_module
=
0
;
int
is_pe
=
(
opts
->
target_platform
==
PLATFORM_WINDOWS
||
opts
->
target_platform
==
PLATFORM_CYGWIN
);
unsigned
int
j
;
...
...
@@ -1098,6 +1090,19 @@ static void build(struct options* opts)
}
if
(
!
opts
->
nostdlib
&&
!
is_pe
)
add_library
(
opts
,
lib_dirs
,
files
,
"wine"
);
/* set default entry point, if needed */
if
(
!
opts
->
entry_point
)
{
if
(
is_pe
)
{
if
(
opts
->
subsystem
&&
!
strcmp
(
opts
->
subsystem
,
"native"
))
entry_point
=
opts
->
target_cpu
==
CPU_x86
?
"_DriverEntry@8"
:
"DriverEntry"
;
}
else
if
(
!
opts
->
shared
&&
opts
->
unicode_app
)
entry_point
=
"__wine_spec_exe_wentry"
;
}
else
entry_point
=
opts
->
entry_point
;
/* run winebuild to generate the .spec.o file */
spec_args
=
get_winebuild_args
(
opts
);
strarray_add
(
spec_args
,
strmake
(
"--cc-cmd=%s"
,
build_tool_name
(
opts
,
"gcc"
,
CC
)));
...
...
@@ -1133,14 +1138,15 @@ static void build(struct options* opts)
strarray_add
(
spec_args
,
output_name
);
strarray_add
(
spec_args
,
"--subsystem"
);
strarray_add
(
spec_args
,
opts
->
gui_app
?
"windows"
:
"console"
);
if
(
opts
->
unicode_app
)
{
strarray_add
(
spec_args
,
"--entry"
);
strarray_add
(
spec_args
,
"__wine_spec_exe_wentry"
);
}
if
(
opts
->
large_address_aware
)
strarray_add
(
spec_args
,
"--large-address-aware"
);
}
if
(
entry_point
)
{
strarray_add
(
spec_args
,
"--entry"
);
strarray_add
(
spec_args
,
entry_point
);
}
if
(
opts
->
subsystem
)
{
strarray_add
(
spec_args
,
"--subsystem"
);
...
...
@@ -1196,6 +1202,8 @@ static void build(struct options* opts)
for
(
j
=
0
;
j
<
lib_dirs
->
size
;
j
++
)
strarray_add
(
link_args
,
strmake
(
"-L%s"
,
lib_dirs
->
base
[
j
]));
if
(
is_pe
&&
entry_point
)
strarray_add
(
link_args
,
strmake
(
"-Wl,--entry,%s"
,
entry_point
));
strarray_add
(
link_args
,
spec_o_name
);
if
(
is_pe
)
...
...
@@ -1677,6 +1685,11 @@ int main(int argc, char **argv)
opts
.
subsystem
=
strdup
(
Wl
->
base
[
++
j
]
);
continue
;
}
if
(
!
strcmp
(
Wl
->
base
[
j
],
"--entry"
)
&&
j
<
Wl
->
size
-
1
)
{
opts
.
entry_point
=
strdup
(
Wl
->
base
[
++
j
]
);
continue
;
}
if
(
!
strcmp
(
Wl
->
base
[
j
],
"-delayload"
)
&&
j
<
Wl
->
size
-
1
)
{
strarray_add
(
opts
.
delayimports
,
Wl
->
base
[
++
j
]
);
...
...
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