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
2374cd52
Commit
2374cd52
authored
Aug 27, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Aug 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Set the LDDLLFLAGS according to the target platform.
parent
810ec233
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
136 deletions
+70
-136
configure
configure
+0
-113
configure.ac
configure.ac
+0
-19
Makefile.in
tools/winegcc/Makefile.in
+0
-1
utils.c
tools/winegcc/utils.c
+2
-1
utils.h
tools/winegcc/utils.h
+1
-1
winegcc.c
tools/winegcc/winegcc.c
+67
-1
No files found.
configure
View file @
2374cd52
...
...
@@ -712,7 +712,6 @@ LDD
LDRPATH_LOCAL
LDRPATH_INSTALL
IMPLIBEXT
LDDLLFLAGS
DLLFLAGS
DLLEXT
CPP
...
...
@@ -6411,8 +6410,6 @@ DLLEXT=""
DLLFLAGS
=
"-D_REENTRANT"
LDDLLFLAGS
=
""
IMPLIBEXT
=
"def"
LDRPATH_INSTALL
=
""
...
...
@@ -6699,7 +6696,6 @@ clean::
DLLEXT
=
".so"
LIBEXT
=
"dylib"
DLLFLAGS
=
"
$DLLFLAGS
-fPIC"
LDDLLFLAGS
=
"-bundle -multiply_defined suppress"
LIBWINE_LDFLAGS
=
"-multiply_defined suppress"
LDRPATH_INSTALL
=
"-Wl,-rpath,@loader_path/
\`\$
(RELPATH)
\$
(bindir)
\$
(libdir)
\`
"
LDRPATH_LOCAL
=
"-Wl,-rpath,@loader_path/
\$
(top_builddir)/libs/wine"
...
...
@@ -6807,10 +6803,6 @@ done
LIBS
=
"
$ac_save_LIBS
"
fi
case
$host_cpu
in
*
powerpc
*
)
LDDLLFLAGS
=
"
$LDDLLFLAGS
-read_only_relocs warning"
;;
esac
if
test
"
$ac_cv_header_QuickTime_ImageCompression_h
"
=
"yes"
then
QUICKTIMELIB
=
"-framework QuickTime -framework ApplicationServices -framework CoreVideo"
...
...
@@ -6907,57 +6899,6 @@ clean::
linux-android
*
)
DLLFLAGS
=
"
$DLLFLAGS
-fPIC"
DLLEXT
=
".so"
LDDLLFLAGS
=
"-shared -Wl,-Bsymbolic"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-fPIC -shared -Wl,-Bsymbolic,-z,defs"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
yes
else
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
"
>
&5
$as_echo
"
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
"
>
&6
;
}
if
test
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
yes
;
then
:
LDDLLFLAGS
=
"
$LDDLLFLAGS
,-z,defs"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
yes
else
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
"
>
&5
$as_echo
"
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
"
>
&6
;
}
if
test
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
yes
;
then
:
LDDLLFLAGS
=
"
$LDDLLFLAGS
,-init,__wine_spec_init,-fini,__wine_spec_fini"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -Wl,--export-dynamic"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -Wl,--export-dynamic... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__Wl___export_dynamic
+
:
}
false
;
then
:
...
...
@@ -7144,7 +7085,6 @@ $as_echo "$ac_cv_c_dll_gnuelf" >&6; }
if
test
"
$ac_cv_c_dll_gnuelf
"
=
"yes"
then
LDSHARED
=
"
\$
(CC) -shared"
LDDLLFLAGS
=
"-shared -Wl,-Bsymbolic"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1
+
:
}
false
;
then
:
...
...
@@ -7197,58 +7137,6 @@ if test $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1 = yes; then :
fi
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-z,defs... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-fPIC -shared -Wl,-Bsymbolic,-z,defs"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
yes
else
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
"
>
&5
$as_echo
"
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
"
>
&6
;
}
if
test
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__z_defs
=
yes
;
then
:
LDDLLFLAGS
=
"
$LDDLLFLAGS
,-z,defs"
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini... "
>
&6
;
}
if
${
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
yes
else
ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
"
>
&5
$as_echo
"
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
"
>
&6
;
}
if
test
$ac_cv_cflags__fPIC__shared__Wl__Bsymbolic__init___wine_spec_init__fini___wine_spec_fini
=
yes
;
then
:
LDDLLFLAGS
=
"
$LDDLLFLAGS
,-init,__wine_spec_init,-fini,__wine_spec_fini"
fi
echo
'{ global: *; };'
>
conftest.map
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -fPIC -shared -Wl,--version-script=conftest.map"
>
&5
$as_echo_n
"checking whether the compiler supports -fPIC -shared -Wl,--version-script=conftest.map... "
>
&6
;
}
...
...
@@ -7493,7 +7381,6 @@ $as_echo "$ac_cv_c_dll_unixware" >&6; }
if
test
"
$ac_cv_c_dll_unixware
"
=
"yes"
then
LDSHARED
=
"
\$
(CC) -Wl,-G,-h,libwine.so.
\$
(SOVERSION)"
LDDLLFLAGS
=
"-Wl,-G,-B,symbolic"
fi
fi
LIBWINE_RULES
=
"
...
...
configure.ac
View file @
2374cd52
...
...
@@ -677,7 +677,6 @@ dnl **** Check for working dll ****
AC_SUBST(DLLEXT,"")
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
AC_SUBST(LDDLLFLAGS,"")
AC_SUBST(IMPLIBEXT,"def")
AC_SUBST(LDRPATH_INSTALL,"")
AC_SUBST(LDRPATH_LOCAL,"")
...
...
@@ -738,7 +737,6 @@ clean::
DLLEXT=".so"
LIBEXT="dylib"
DLLFLAGS="$DLLFLAGS -fPIC"
LDDLLFLAGS="-bundle -multiply_defined suppress"
LIBWINE_LDFLAGS="-multiply_defined suppress"
LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`"
LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine"
...
...
@@ -803,11 +801,6 @@ clean::
AC_CHECK_FUNCS(IOHIDManagerCreate)
LIBS="$ac_save_LIBS"
fi
case $host_cpu in
*powerpc*)
LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning" dnl FIXME
;;
esac
if test "$ac_cv_header_QuickTime_ImageCompression_h" = "yes"
then
AC_SUBST(QUICKTIMELIB,"-framework QuickTime -framework ApplicationServices -framework CoreVideo")
...
...
@@ -877,11 +870,6 @@ clean::
linux-android*)
DLLFLAGS="$DLLFLAGS -fPIC"
DLLEXT=".so"
LDDLLFLAGS="-shared -Wl,-Bsymbolic"
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
[LDDLLFLAGS="$LDDLLFLAGS,-z,defs"])
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
[LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"])
WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
[AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])])
WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
...
...
@@ -927,17 +915,11 @@ clean::
if test "$ac_cv_c_dll_gnuelf" = "yes"
then
LDSHARED="\$(CC) -shared"
LDDLLFLAGS="-shared -Wl,-Bsymbolic"
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
[LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so.\$(SOVERSION)"],
[WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
[LDSHARED="\$(CC) -shared -Wl,-h,libwine.so.\$(SOVERSION)"])])
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs], [LDDLLFLAGS="$LDDLLFLAGS,-z,defs"])
WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
[LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"])
echo '{ global: *; };' >conftest.map
WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
[LDSHARED="$LDSHARED -Wl,--version-script=\$(srcdir)/wine.map"])
...
...
@@ -979,7 +961,6 @@ clean::
if test "$ac_cv_c_dll_unixware" = "yes"
then
LDSHARED="\$(CC) -Wl,-G,-h,libwine.so.\$(SOVERSION)"
LDDLLFLAGS="-Wl,-G,-B,symbolic"
fi
fi
AC_SUBST(LIBWINE_RULES,["
...
...
tools/winegcc/Makefile.in
View file @
2374cd52
...
...
@@ -3,7 +3,6 @@ DEFS = \
-DDLLDIR
=
"
\"
$(dlldir)
\"
"
\
-DLIBDIR
=
"
\"
$(libdir)
\"
"
\
-DDLLFLAGS
=
"
\"
@DLLFLAGS@
\"
"
\
-DLDDLLFLAGS
=
"
\"
@LDDLLFLAGS@
\"
"
\
-DCC
=
"
\"
$(CC)
\"
"
\
-DCPP
=
"
\"
@CPPBIN@
\"
"
\
-DCXX
=
"
\"
@CXX@
\"
"
\
...
...
tools/winegcc/utils.c
View file @
2374cd52
...
...
@@ -297,7 +297,7 @@ file_type get_lib_type(enum target_platform platform, strarray* path, const char
return
file_na
;
}
void
spawn
(
const
strarray
*
prefix
,
const
strarray
*
args
,
int
ignore_errors
)
int
spawn
(
const
strarray
*
prefix
,
const
strarray
*
args
,
int
ignore_errors
)
{
unsigned
int
i
;
int
status
;
...
...
@@ -343,4 +343,5 @@ void spawn(const strarray* prefix, const strarray* args, int ignore_errors)
free
(
prog
);
strarray_free
(
arr
);
return
status
;
}
tools/winegcc/utils.h
View file @
2374cd52
...
...
@@ -78,6 +78,6 @@ void create_file(const char* name, int mode, const char* fmt, ...);
file_type
get_file_type
(
const
char
*
filename
);
file_type
get_lib_type
(
enum
target_platform
platform
,
strarray
*
path
,
const
char
*
library
,
const
char
*
suffix
,
char
**
file
);
void
spawn
(
const
strarray
*
prefix
,
const
strarray
*
arr
,
int
ignore_errors
);
int
spawn
(
const
strarray
*
prefix
,
const
strarray
*
arr
,
int
ignore_errors
);
extern
int
verbose
;
tools/winegcc/winegcc.c
View file @
2374cd52
...
...
@@ -330,6 +330,72 @@ static const strarray* get_translator(struct options *opts)
return
ret
;
}
static
int
try_link
(
const
strarray
*
prefix
,
const
strarray
*
link_tool
,
const
char
*
cflags
)
{
const
char
*
in
=
get_temp_file
(
"try_link"
,
".c"
);
const
char
*
out
=
get_temp_file
(
"try_link"
,
".out"
);
strarray
*
link
=
strarray_dup
(
link_tool
);
int
ret
;
create_file
(
in
,
0644
,
"int main(void){return 1;}"
);
strarray_add
(
link
,
"-o"
);
strarray_add
(
link
,
out
);
strarray_addall
(
link
,
strarray_fromstring
(
cflags
,
" "
)
);
strarray_add
(
link
,
in
);
ret
=
spawn
(
prefix
,
link
,
1
);
strarray_free
(
link
);
return
ret
;
}
static
const
strarray
*
get_lddllflags
(
const
struct
options
*
opts
,
const
strarray
*
link_tool
)
{
strarray
*
flags
=
strarray_alloc
();
switch
(
opts
->
target_platform
)
{
case
PLATFORM_APPLE
:
strarray_add
(
flags
,
"-bundle"
);
strarray_add
(
flags
,
"-multiply_defined"
);
strarray_add
(
flags
,
"suppress"
);
if
(
opts
->
target_cpu
==
CPU_POWERPC
)
{
strarray_add
(
flags
,
"-read_only_relocs"
);
strarray_add
(
flags
,
"warning"
);
}
break
;
case
PLATFORM_SOLARIS
:
strarray_add
(
flags
,
"-Wl,-G,-B,symbolic"
);
break
;
case
PLATFORM_UNSPECIFIED
:
strarray_add
(
flags
,
"-shared"
);
strarray_add
(
flags
,
"-Wl,-Bsymbolic"
);
/* Try all options first - this is likely to succeed on modern compilers */
if
(
!
try_link
(
opts
->
prefix
,
link_tool
,
"-fPIC -shared -Wl,-Bsymbolic "
"-Wl,-z,defs -Wl,-init,__wine_spec_init,-fini,_wine_spec_fini"
))
{
strarray_add
(
flags
,
"-Wl,-z,defs"
);
strarray_add
(
flags
,
"-Wl,-init,__wine_spec_init,-fini,__wine_spec_fini"
);
}
else
/* otherwise figure out which ones are allowed */
{
if
(
!
try_link
(
opts
->
prefix
,
link_tool
,
"-fPIC -shared -Wl,-Bsymbolic -Wl,-z,defs"
))
strarray_add
(
flags
,
"-Wl,-z,defs"
);
if
(
!
try_link
(
opts
->
prefix
,
link_tool
,
"-fPIC -shared -Wl,-Bsymbolic "
"-Wl,-init,__wine_spec_init,-fini,_wine_spec_fini"
))
strarray_add
(
flags
,
"-Wl,-init,__wine_spec_init,-fini,__wine_spec_fini"
);
}
break
;
default:
assert
(
0
);
}
return
flags
;
}
/* check that file is a library for the correct platform */
static
int
check_platform
(
struct
options
*
opts
,
const
char
*
file
)
{
...
...
@@ -1008,7 +1074,7 @@ static void build(struct options* opts)
/* link everything together now */
strarray_addall
(
link_args
,
get_translator
(
opts
));
strarray_addall
(
link_args
,
strarray_fromstring
(
LDDLLFLAGS
,
" "
));
strarray_addall
(
link_args
,
get_lddllflags
(
opts
,
link_args
));
strarray_add
(
link_args
,
"-o"
);
strarray_add
(
link_args
,
strmake
(
"%s.so"
,
output_file
));
...
...
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