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
2b87c82e
Commit
2b87c82e
authored
Aug 19, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a --undefined option to allow forcing some symbols to be
resolved by the linker.
parent
eb889cf5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
26 deletions
+48
-26
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+16
-5
main.c
tools/winebuild/main.c
+26
-21
winebuild.man.in
tools/winebuild/winebuild.man.in
+5
-0
No files found.
tools/winebuild/build.h
View file @
2b87c82e
...
@@ -190,6 +190,7 @@ extern const char *get_asm_short_keyword(void);
...
@@ -190,6 +190,7 @@ extern const char *get_asm_short_keyword(void);
extern
void
add_import_dll
(
const
char
*
name
,
const
char
*
filename
);
extern
void
add_import_dll
(
const
char
*
name
,
const
char
*
filename
);
extern
void
add_delayed_import
(
const
char
*
name
);
extern
void
add_delayed_import
(
const
char
*
name
);
extern
void
add_ignore_symbol
(
const
char
*
name
);
extern
void
add_ignore_symbol
(
const
char
*
name
);
extern
void
add_extra_ld_symbol
(
const
char
*
name
);
extern
void
read_undef_symbols
(
char
**
argv
);
extern
void
read_undef_symbols
(
char
**
argv
);
extern
int
resolve_imports
(
DLLSPEC
*
spec
);
extern
int
resolve_imports
(
DLLSPEC
*
spec
);
extern
int
output_imports
(
FILE
*
outfile
,
DLLSPEC
*
spec
,
int
*
nb_delayed
);
extern
int
output_imports
(
FILE
*
outfile
,
DLLSPEC
*
spec
,
int
*
nb_delayed
);
...
...
tools/winebuild/import.c
View file @
2b87c82e
...
@@ -60,6 +60,7 @@ struct name_table
...
@@ -60,6 +60,7 @@ struct name_table
static
struct
name_table
undef_symbols
;
/* list of undefined symbols */
static
struct
name_table
undef_symbols
;
/* list of undefined symbols */
static
struct
name_table
ignore_symbols
;
/* list of symbols to ignore */
static
struct
name_table
ignore_symbols
;
/* list of symbols to ignore */
static
struct
name_table
extra_ld_symbols
;
/* list of extra symbols that ld should resolve */
static
struct
name_table
delayed_imports
;
/* list of delayed import dlls */
static
struct
name_table
delayed_imports
;
/* list of delayed import dlls */
static
char
*
ld_tmp_file
;
/* ld temp file name */
static
char
*
ld_tmp_file
;
/* ld temp file name */
...
@@ -438,6 +439,12 @@ void add_ignore_symbol( const char *name )
...
@@ -438,6 +439,12 @@ void add_ignore_symbol( const char *name )
else
add_name
(
&
ignore_symbols
,
name
);
else
add_name
(
&
ignore_symbols
,
name
);
}
}
/* add a symbol to the list of extra symbols that ld must resolve */
void
add_extra_ld_symbol
(
const
char
*
name
)
{
add_name
(
&
extra_ld_symbols
,
name
);
}
/* add a function to the list of imports from a given dll */
/* add a function to the list of imports from a given dll */
static
void
add_import_func
(
struct
import
*
imp
,
ORDDEF
*
func
)
static
void
add_import_func
(
struct
import
*
imp
,
ORDDEF
*
func
)
{
{
...
@@ -546,8 +553,8 @@ static int check_unused( const struct import* imp, const DLLSPEC *spec )
...
@@ -546,8 +553,8 @@ static int check_unused( const struct import* imp, const DLLSPEC *spec )
/* returns the name of the combined file */
/* returns the name of the combined file */
static
const
char
*
ldcombine_files
(
char
**
argv
)
static
const
char
*
ldcombine_files
(
char
**
argv
)
{
{
int
i
,
len
=
0
;
unsigned
int
i
,
len
=
0
;
char
*
cmd
;
char
*
cmd
,
*
p
;
int
fd
,
err
;
int
fd
,
err
;
if
(
output_file_name
&&
output_file_name
[
0
])
if
(
output_file_name
&&
output_file_name
[
0
])
...
@@ -563,10 +570,14 @@ static const char *ldcombine_files( char **argv )
...
@@ -563,10 +570,14 @@ static const char *ldcombine_files( char **argv )
atexit
(
remove_ld_tmp_file
);
atexit
(
remove_ld_tmp_file
);
if
(
!
ld_command
)
ld_command
=
xstrdup
(
"ld"
);
if
(
!
ld_command
)
ld_command
=
xstrdup
(
"ld"
);
for
(
i
=
0
;
i
<
extra_ld_symbols
.
count
;
i
++
)
len
+=
strlen
(
extra_ld_symbols
.
names
[
i
])
+
5
;
for
(
i
=
0
;
argv
[
i
];
i
++
)
len
+=
strlen
(
argv
[
i
])
+
1
;
for
(
i
=
0
;
argv
[
i
];
i
++
)
len
+=
strlen
(
argv
[
i
])
+
1
;
cmd
=
xmalloc
(
len
+
strlen
(
ld_tmp_file
)
+
8
+
strlen
(
ld_command
)
);
cmd
=
p
=
xmalloc
(
len
+
strlen
(
ld_tmp_file
)
+
8
+
strlen
(
ld_command
)
);
sprintf
(
cmd
,
"%s -r -o %s"
,
ld_command
,
ld_tmp_file
);
p
+=
sprintf
(
cmd
,
"%s -r -o %s"
,
ld_command
,
ld_tmp_file
);
for
(
i
=
0
;
argv
[
i
];
i
++
)
sprintf
(
cmd
+
strlen
(
cmd
),
" %s"
,
argv
[
i
]
);
for
(
i
=
0
;
i
<
extra_ld_symbols
.
count
;
i
++
)
p
+=
sprintf
(
p
,
" -u %s"
,
asm_name
(
extra_ld_symbols
.
names
[
i
])
);
for
(
i
=
0
;
argv
[
i
];
i
++
)
p
+=
sprintf
(
p
,
" %s"
,
argv
[
i
]
);
err
=
system
(
cmd
);
err
=
system
(
cmd
);
if
(
err
)
fatal_error
(
"%s -r failed with status %d
\n
"
,
ld_command
,
err
);
if
(
err
)
fatal_error
(
"%s -r failed with status %d
\n
"
,
ld_command
,
err
);
free
(
cmd
);
free
(
cmd
);
...
...
tools/winebuild/main.c
View file @
2b87c82e
...
@@ -234,31 +234,32 @@ static void exit_on_signal( int sig )
...
@@ -234,31 +234,32 @@ static void exit_on_signal( int sig )
static
const
char
usage_str
[]
=
static
const
char
usage_str
[]
=
"Usage: winebuild [OPTIONS] [FILES]
\n\n
"
"Usage: winebuild [OPTIONS] [FILES]
\n\n
"
"Options:
\n
"
"Options:
\n
"
"
-C
--source-dir=DIR Look for source files in DIR
\n
"
"
-C,
--source-dir=DIR Look for source files in DIR
\n
"
"
-d
--delay-lib=LIB Import the specified library in delayed mode
\n
"
"
-d,
--delay-lib=LIB Import the specified library in delayed mode
\n
"
"
-D SYM
Ignored for C flags compatibility
\n
"
"
-D SYM
Ignored for C flags compatibility
\n
"
"
-E
--export=FILE Export the symbols defined in the .spec or .def file
\n
"
"
-E,
--export=FILE Export the symbols defined in the .spec or .def file
\n
"
"
-e
--entry=FUNC Set the DLL entry point function (default: DllMain)
\n
"
"
-e,
--entry=FUNC Set the DLL entry point function (default: DllMain)
\n
"
"
-f FLAGS
Compiler flags (only -fPIC is supported)
\n
"
"
-f FLAGS
Compiler flags (only -fPIC is supported)
\n
"
"
-F
--filename=DLLFILE Set the DLL filename (default: from input file name)
\n
"
"
-F,
--filename=DLLFILE Set the DLL filename (default: from input file name)
\n
"
"
-h
--help Display this help message
\n
"
"
-h,
--help Display this help message
\n
"
"
-H
--heap=SIZE Set the heap size for a Win16 dll
\n
"
"
-H,
--heap=SIZE Set the heap size for a Win16 dll
\n
"
"
-i
--ignore=SYM[,SYM] Ignore specified symbols when resolving imports
\n
"
"
-i,
--ignore=SYM[,SYM] Ignore specified symbols when resolving imports
\n
"
"
-I DIR
Ignored for C flags compatibility
\n
"
"
-I DIR
Ignored for C flags compatibility
\n
"
"
-k
--kill-at Kill stdcall decorations in generated .def files
\n
"
"
-k,
--kill-at Kill stdcall decorations in generated .def files
\n
"
"
-K
FLAGS Compiler flags (only -KPIC is supported)
\n
"
"
-K,
FLAGS Compiler flags (only -KPIC is supported)
\n
"
" --ld-cmd=LD Command to use for linking (default: ld)
\n
"
" --ld-cmd=LD Command to use for linking (default: ld)
\n
"
"
-l
--library=LIB Import the specified library
\n
"
"
-l,
--library=LIB Import the specified library
\n
"
"
-L
--library-path=DIR Look for imports libraries in DIR
\n
"
"
-L,
--library-path=DIR Look for imports libraries in DIR
\n
"
"
-M
--main-module=MODULE Set the name of the main module for a Win16 dll
\n
"
"
-M,
--main-module=MODULE Set the name of the main module for a Win16 dll
\n
"
" --nm-cmd=NM Command to use to get undefined symbols (default: nm)
\n
"
" --nm-cmd=NM Command to use to get undefined symbols (default: nm)
\n
"
"
-N
--dll-name=DLLNAME Set the DLL name (default: from input file name)
\n
"
"
-N,
--dll-name=DLLNAME Set the DLL name (default: from input file name)
\n
"
"
-o
--output=NAME Set the output file name (default: stdout)
\n
"
"
-o,
--output=NAME Set the output file name (default: stdout)
\n
"
"
-r
--res=RSRC.RES Load resources from RSRC.RES
\n
"
"
-r,
--res=RSRC.RES Load resources from RSRC.RES
\n
"
" --subsystem=SUBSYS Set the subsystem (one of native, windows, console)
\n
"
" --subsystem=SUBSYS Set the subsystem (one of native, windows, console)
\n
"
" --target=TARGET Specify target CPU and platform for cross-compiling
\n
"
" --target=TARGET Specify target CPU and platform for cross-compiling
\n
"
" -u, --undefined=SYMBOL Add an undefined reference to SYMBOL when linking
\n
"
" --version Print the version and exit
\n
"
" --version Print the version and exit
\n
"
"
-w
--warnings Turn on warnings
\n
"
"
-w,
--warnings Turn on warnings
\n
"
"
\n
Mode options:
\n
"
"
\n
Mode options:
\n
"
" --dll Build a .c file from a .spec or .def file
\n
"
" --dll Build a .c file from a .spec or .def file
\n
"
" --def Build a .def file from a .spec file
\n
"
" --def Build a .def file from a .spec file
\n
"
...
@@ -283,7 +284,7 @@ enum long_options_values
...
@@ -283,7 +284,7 @@ enum long_options_values
LONG_OPT_VERSION
LONG_OPT_VERSION
};
};
static
const
char
short_options
[]
=
"C:D:E:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:w"
;
static
const
char
short_options
[]
=
"C:D:E:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:
u:
w"
;
static
const
struct
option
long_options
[]
=
static
const
struct
option
long_options
[]
=
{
{
...
@@ -314,6 +315,7 @@ static const struct option long_options[] =
...
@@ -314,6 +315,7 @@ static const struct option long_options[] =
{
"dll-name"
,
1
,
0
,
'N'
},
{
"dll-name"
,
1
,
0
,
'N'
},
{
"output"
,
1
,
0
,
'o'
},
{
"output"
,
1
,
0
,
'o'
},
{
"res"
,
1
,
0
,
'r'
},
{
"res"
,
1
,
0
,
'r'
},
{
"undefined"
,
1
,
0
,
'u'
},
{
"warnings"
,
0
,
0
,
'w'
},
{
"warnings"
,
0
,
0
,
'w'
},
{
NULL
,
0
,
0
,
0
}
{
NULL
,
0
,
0
,
0
}
};
};
...
@@ -421,6 +423,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
...
@@ -421,6 +423,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
res_files
=
xrealloc
(
res_files
,
(
nb_res_files
+
1
)
*
sizeof
(
*
res_files
)
);
res_files
=
xrealloc
(
res_files
,
(
nb_res_files
+
1
)
*
sizeof
(
*
res_files
)
);
res_files
[
nb_res_files
++
]
=
xstrdup
(
optarg
);
res_files
[
nb_res_files
++
]
=
xstrdup
(
optarg
);
break
;
break
;
case
'u'
:
add_extra_ld_symbol
(
optarg
);
break
;
case
'w'
:
case
'w'
:
display_warnings
=
1
;
display_warnings
=
1
;
break
;
break
;
...
...
tools/winebuild/winebuild.man.in
View file @
2b87c82e
...
@@ -196,6 +196,11 @@ Specify the target CPU and platform on which the generated code will
...
@@ -196,6 +196,11 @@ Specify the target CPU and platform on which the generated code will
be built. The target specification is in the standard autoconf format
be built. The target specification is in the standard autoconf format
as returned by config.sub.
as returned by config.sub.
.TP
.TP
.BI \-u,\ --undefined= symbol
Add \fIsymbol\fR to the list of undefined symbols when invoking the
linker. This makes it possible to force a specific module of a static
library to be included when resolving imports.
.TP
.B \--version
.B \--version
Display the program version and exit.
Display the program version and exit.
.TP
.TP
...
...
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