Alexandre Julliard : winebuild: Allow specifying a spec file also for Unix libraries.
Alexandre Julliard
julliard at winehq.org
Mon Jul 6 16:20:45 CDT 2020
Module: wine
Branch: master
Commit: 66fb3802d31b34360f87edd11eb6508bca785824
URL: https://source.winehq.org/git/wine.git/?a=commit;h=66fb3802d31b34360f87edd11eb6508bca785824
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jul 6 15:50:00 2020 +0200
winebuild: Allow specifying a spec file also for Unix libraries.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/makedep.c | 2 ++
tools/winebuild/import.c | 9 +++++++++
tools/winebuild/spec32.c | 11 +++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c
index bdeae8f65a..825458156f 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -3349,6 +3349,7 @@ static void output_module( struct makefile *make )
strarray_add( &make->all_targets, unix_lib );
add_install_rule( make, make->module, unix_lib, strmake( "p$(dlldir)/%s", unix_lib ));
output( "%s:", unix_lib );
+ if (spec_file) output_filename( spec_file );
output_filenames_obj_dir( make, make->unixobj_files );
output_filenames( unix_deps );
output_filename( tools_path( make, "winebuild" ));
@@ -3357,6 +3358,7 @@ static void output_module( struct makefile *make )
output_winegcc_command( make, 0 );
output_filename( "-munix" );
output_filename( "-shared" );
+ if (spec_file) output_filename( spec_file );
if (strarray_exists( &make->extradllflags, "-nodefaultlibs" )) output_filename( "-nodefaultlibs" );
output_filenames_obj_dir( make, make->unixobj_files );
output_filenames( unix_libs );
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 616b9842ce..125b6132b6 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -460,6 +460,9 @@ static void add_undef_import( const char *name, int is_ordinal )
static int has_stubs( const DLLSPEC *spec )
{
int i;
+
+ if (unix_lib) return 0;
+
for (i = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
@@ -503,6 +506,8 @@ static void check_undefined_forwards( DLLSPEC *spec )
char *link_name, *api_name, *dll_name, *p;
int i;
+ if (unix_lib) return;
+
for (i = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
@@ -533,6 +538,8 @@ static void check_undefined_exports( DLLSPEC *spec )
{
int i;
+ if (unix_lib) return;
+
for (i = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
@@ -570,6 +577,8 @@ static char *create_undef_symbols_file( DLLSPEC *spec )
int i;
unsigned int j;
+ if (unix_lib) return NULL;
+
as_file = open_temp_output_file( ".s" );
output( "\t.data\n" );
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 5f74d2f29b..f7eeb785b8 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -96,6 +96,13 @@ static int has_relays( DLLSPEC *spec )
return 0;
}
+static int get_exports_count( DLLSPEC *spec )
+{
+ if (unix_lib) return 0;
+ if (spec->base > spec->limit) return 0;
+ return spec->limit - spec->base + 1;
+}
+
static int cmp_func_args( const void *p1, const void *p2 )
{
const ORDDEF *odp1 = *(const ORDDEF **)p1;
@@ -384,7 +391,7 @@ void output_exports( DLLSPEC *spec )
int i, fwd_size = 0;
int needs_imports = 0;
int needs_relay = has_relays( spec );
- int nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0;
+ int nr_exports = get_exports_count( spec );
const char *func_ptr = (target_platform == PLATFORM_WINDOWS) ? ".rva" : get_asm_ptr_keyword();
const char *name;
@@ -704,7 +711,7 @@ void output_module( DLLSPEC *spec )
output( "\t.long 0\n" ); /* LoaderFlags */
output( "\t.long 16\n" ); /* NumberOfRvaAndSizes */
- if (spec->base <= spec->limit)
+ if (get_exports_count( spec ))
data_dirs[0] = ".L__wine_spec_exports"; /* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT] */
if (has_imports())
data_dirs[1] = ".L__wine_spec_imports"; /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */
More information about the wine-cvs
mailing list