Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
857f1e09
Commit
857f1e09
authored
15 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
configure: Detect the appropriate form for the __ASM_GLOBAL_FUNC macro.
parent
79d981b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+154
-18
154 additions, 18 deletions
configure
configure.ac
+44
-14
44 additions, 14 deletions
configure.ac
include/config.h.in
+3
-0
3 additions, 0 deletions
include/config.h.in
include/wine/port.h
+0
-23
0 additions, 23 deletions
include/wine/port.h
with
201 additions
and
55 deletions
configure
+
154
−
18
View file @
857f1e09
...
@@ -17507,6 +17507,80 @@ $as_echo "$ac_cv_c_string_h_warnings" >&6; }
...
@@ -17507,6 +17507,80 @@ $as_echo "$ac_cv_c_string_h_warnings" >&6; }
fi
fi
{ $as_echo "$as_me:$LINENO: checking whether external symbols need an underscore prefix" >&5
$as_echo_n "checking whether external symbols need an underscore prefix... " >&6; }
if test "${ac_cv_c_extern_prefix+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
extern int ac_test;
int
main ()
{
asm(".globl _ac_test\n_ac_test:\t.long 0"); if (ac_test) return 1
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_c_extern_prefix="yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_extern_prefix="no"
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_extern_prefix" >&5
$as_echo "$ac_cv_c_extern_prefix" >&6; }
if test "$ac_cv_c_extern_prefix" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define __ASM_NAME(name) "_" name
_ACEOF
asm_name_prefix="_"
else
cat >>confdefs.h <<\_ACEOF
#define __ASM_NAME(name) name
_ACEOF
asm_name_prefix=""
fi
{ $as_echo "$as_me:$LINENO: checking how to define a function in assembly code" >&5
{ $as_echo "$as_me:$LINENO: checking how to define a function in assembly code" >&5
$as_echo_n "checking how to define a function in assembly code... " >&6; }
$as_echo_n "checking how to define a function in assembly code... " >&6; }
if test "${ac_cv_asm_func_def+set}" = set; then
if test "${ac_cv_asm_func_def+set}" = set; then
...
@@ -17662,28 +17736,82 @@ case "$ac_cv_asm_func_def" in
...
@@ -17662,28 +17736,82 @@ case "$ac_cv_asm_func_def" in
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
#define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
_ACEOF
_ACEOF
;;
asm_func_header=".def $asm_name_prefix\" #name \"; .scl 2; .type 32; .endef" ;;
".type @function")
".type @function")
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function"
#define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function"
_ACEOF
_ACEOF
;;
asm_func_header=".type $asm_name_prefix\" #name \",@function" ;;
".type 2")
".type 2")
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",2"
#define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",2"
_ACEOF
_ACEOF
;;
asm_func_header=".type $asm_name_prefix\" #name \",2" ;;
*)
*)
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define __ASM_FUNC(name) ""
#define __ASM_FUNC(name) ""
_ACEOF
_ACEOF
;;
asm_func_header="" ;;
esac
esac
{ $as_echo "$as_me:$LINENO: checking whether asm() works outside of functions" >&5
$as_echo_n "checking whether asm() works outside of functions... " >&6; }
if test "${ac_cv_c_asm_outside_funcs+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
asm(".text\n\t.long 0");
int
main ()
{
{ $as_echo "$as_me:$LINENO: checking whether external symbols need an underscore prefix" >&5
;
$as_echo_n "checking whether external symbols need an underscore prefix... " >&6; }
return 0;
if test "${ac_cv_c_extern_prefix+set}" = set; then
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_asm_outside_funcs="yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_asm_outside_funcs="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_asm_outside_funcs" >&5
$as_echo "$ac_cv_c_asm_outside_funcs" >&6; }
{ $as_echo "$as_me:$LINENO: checking whether .previous is supported in assembly code" >&5
$as_echo_n "checking whether .previous is supported in assembly code... " >&6; }
if test "${ac_cv_c_dot_previous+set}" = set; then
$as_echo_n "(cached) " >&6
$as_echo_n "(cached) " >&6
else
else
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
...
@@ -17692,11 +17820,11 @@ _ACEOF
...
@@ -17692,11 +17820,11 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* end confdefs.h. */
extern int ac_test;
int
int
main ()
main ()
{
{
asm(".
globl _ac_
te
s
t\n
_
ac_test:\t.long 0
"); if (ac_test) return 1
asm(".te
x
t\nac_test:\t.long 0
\n\t.previous");
;
;
return 0;
return 0;
}
}
...
@@ -17722,32 +17850,40 @@ $as_echo "$ac_try_echo") >&5
...
@@ -17722,32 +17850,40 @@ $as_echo "$ac_try_echo") >&5
test "$cross_compiling" = yes ||
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
$as_test_x conftest$ac_exeext
}; then
}; then
ac_cv_c_
extern_prefix
="yes"
ac_cv_c_
dot_previous
="yes"
else
else
$as_echo "$as_me: failed program was:" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_
extern_prefix
="no"
ac_cv_c_
dot_previous
="no"
fi
fi
rm -rf conftest.dSYM
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
conftest$ac_exeext conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_
extern_prefix
" >&5
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_
dot_previous
" >&5
$as_echo "$ac_cv_c_
extern_prefix
" >&6; }
$as_echo "$ac_cv_c_
dot_previous
" >&6; }
asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
asm_func_trailer=""
if test "$ac_cv_c_dot_previous" = "yes"
then
asm_func_trailer="\\n\\t.previous"
fi
asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
if test "$ac_cv_c_extern_prefix" = "yes"
if test "$ac_cv_c_asm_outside_funcs" = "yes"
then
then
cat >>confdefs.h <<
\
_ACEOF
cat >>confdefs.h <<_ACEOF
#define __ASM_
NAME(name) "_" name
#define __ASM_
GLOBAL_FUNC(name,code) asm(".text\n\t.align 4\n\t$asm_func_code");
_ACEOF
_ACEOF
else
else
cat >>confdefs.h <<
\
_ACEOF
cat >>confdefs.h <<_ACEOF
#define __ASM_
NAME(name) name
#define __ASM_
GLOBAL_FUNC(name,code) void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }
_ACEOF
_ACEOF
fi
fi
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
44
−
14
View file @
857f1e09
...
@@ -1384,6 +1384,24 @@ then
...
@@ -1384,6 +1384,24 @@ then
fi
fi
fi
fi
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
[extern int ac_test;],
[if (ac_test) return 1],
ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
if test "$ac_cv_c_extern_prefix" = "yes"
then
AC_DEFINE([__ASM_NAME(name)], ["_" name])
asm_name_prefix="_"
else
AC_DEFINE([__ASM_NAME(name)], [name])
asm_name_prefix=""
fi
dnl **** Check how to define a function in assembly code ****
dnl **** Check how to define a function in assembly code ****
AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
...
@@ -1399,29 +1417,41 @@ AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
...
@@ -1399,29 +1417,41 @@ AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
case "$ac_cv_asm_func_def" in
case "$ac_cv_asm_func_def" in
".def")
".def")
AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"])
asm_func_header=".def $asm_name_prefix\" #name \"; .scl 2; .type 32; .endef" ;;
".type @function")
".type @function")
AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"])
asm_func_header=".type $asm_name_prefix\" #name \",@function" ;;
".type 2")
".type 2")
AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"])
asm_func_header=".type $asm_name_prefix\" #name \",2" ;;
*)
*)
AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
AC_DEFINE([__ASM_FUNC(name)], [""])
asm_func_header="" ;;
esac
esac
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK([whether asm() works outside of functions], ac_cv_c_asm_outside_funcs,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm(".text\n\t.long 0");]],)],
ac_cv_c_asm_outside_funcs="yes",ac_cv_c_asm_outside_funcs="no"))
AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
AC_CACHE_CHECK([whether .previous is supported in assembly code], ac_cv_c_dot_previous,
WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
WINE_TRY_ASM_LINK([".text\nac_test:\t.long 0\n\t.previous"],,,
[extern int ac_test;],
ac_cv_c_dot_previous="yes",ac_cv_c_dot_previous="no"))
[if (ac_test) return 1],
ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
if test "$ac_cv_c_extern_prefix" = "yes"
asm_func_trailer=""
if test "$ac_cv_c_dot_previous" = "yes"
then
asm_func_trailer="\\n\\t.previous"
fi
asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
AH_TEMPLATE(__ASM_GLOBAL_FUNC,[Define to a macro to generate an assembly function])
if test "$ac_cv_c_asm_outside_funcs" = "yes"
then
then
AC_DEFINE
([__ASM_NAME(name)], ["_" name
])
AC_DEFINE
_UNQUOTED([__ASM_GLOBAL_FUNC(name,code)],[asm(".text\n\t.align 4\n\t$asm_func_code");
])
else
else
AC_DEFINE
([__ASM_NAME(name)], [name
])
AC_DEFINE
_UNQUOTED([__ASM_GLOBAL_FUNC(name,code)],[void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }
])
fi
fi
dnl **** Platform-specific checks ****
dnl **** Platform-specific checks ****
...
...
This diff is collapsed.
Click to expand it.
include/config.h.in
+
3
−
0
View file @
857f1e09
...
@@ -1191,6 +1191,9 @@
...
@@ -1191,6 +1191,9 @@
/* Define to a macro to generate an assembly function directive */
/* Define to a macro to generate an assembly function directive */
#undef __ASM_FUNC
#undef __ASM_FUNC
/* Define to a macro to generate an assembly function */
#undef __ASM_GLOBAL_FUNC
/* Define to a macro to generate an assembly name from a C symbol */
/* Define to a macro to generate an assembly name from a C symbol */
#undef __ASM_NAME
#undef __ASM_NAME
...
...
This diff is collapsed.
Click to expand it.
include/wine/port.h
+
0
−
23
View file @
857f1e09
...
@@ -201,29 +201,6 @@ struct statvfs
...
@@ -201,29 +201,6 @@ struct statvfs
#endif
#endif
/* Macros to define assembler functions somewhat portably */
#if defined(__GNUC__) && !defined(__INTERIX) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__APPLE__)
# define __ASM_GLOBAL_FUNC(name,code) \
__asm__( ".text\n\t" \
".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
__ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \
code \
"\n\t.previous" );
#else
/* defined(__GNUC__) && !defined(__MINGW32__) && !defined(__APPLE__) */
# define __ASM_GLOBAL_FUNC(name,code) \
void __asm_dummy_##name(void) { \
asm( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
__ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \
code ); \
}
#endif
/* __GNUC__ */
/****************************************************************
/****************************************************************
* Function definitions (only when using libwine_port)
* Function definitions (only when using libwine_port)
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment