winebuild: Allow specifying a spec file also for Unix libraries.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-06 15:50:00 +02:00
parent 086072ca6a
commit 66fb3802d3
3 changed files with 20 additions and 2 deletions

View file

@ -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 );

View file

@ -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" );

View file

@ -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] */