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
c55578f3
Commit
c55578f3
authored
Jun 19, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loader: Always build the main loader as PIE if we have a preloader.
parent
78ed3438
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
76 deletions
+48
-76
configure
configure
+33
-60
configure.ac
configure.ac
+15
-16
No files found.
configure
View file @
c55578f3
...
...
@@ -10245,104 +10245,77 @@ if test "x$ac_cv_cflags__Wl___export_dynamic" = xyes
then
:
WINELOADER_LDFLAGS
=
"-Wl,--export-dynamic"
fi
WINEPRELOADER_LDFLAGS
=
"-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000"
case
$host_cpu
in
*
i[3456789]86
*
|
arm
*
)
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000"
>
&5
printf
%s
"checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... "
>
&6
;
}
if
test
${
ac_cv_cflags__Wl__Ttext_segment_0x7bc00000
+y
}
case
$host_os
in
linux
*
)
as_fn_append WINELOADER_LDFLAGS
" -pie"
WINEPRELOADER_LDFLAGS
=
"-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000"
;;
*
)
case
$HOST_ARCH
in
i386|arm
)
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -Wl,-Ttext-segment=0x60000000"
>
&5
printf
%s
"checking whether the compiler supports -Wl,-Ttext-segment=0x60000000... "
>
&6
;
}
if
test
${
ac_cv_cflags__Wl__Ttext_segment_0x60000000
+y
}
then
:
printf
%s
"(cached) "
>
&6
else
$as_nop
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-Wl,-Ttext-segment=0x
7bc
00000"
CFLAGS
=
"
$CFLAGS
-Wl,-Ttext-segment=0x
600
00000"
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__Wl__Ttext_segment_0x
7bc
00000
=
yes
ac_cv_cflags__Wl__Ttext_segment_0x
600
00000
=
yes
else
$as_nop
ac_cv_cflags__Wl__Ttext_segment_0x
7bc
00000
=
no
ac_cv_cflags__Wl__Ttext_segment_0x
600
00000
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.beam
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__Wl__Ttext_segment_0x
7bc
00000
"
>
&5
printf
"%s
\n
"
"
$ac_cv_cflags__Wl__Ttext_segment_0x
7bc
00000
"
>
&6
;
}
if
test
"x
$ac_cv_cflags__Wl__Ttext_segment_0x
7bc
00000
"
=
xyes
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__Wl__Ttext_segment_0x
600
00000
"
>
&5
printf
"%s
\n
"
"
$ac_cv_cflags__Wl__Ttext_segment_0x
600
00000
"
>
&6
;
}
if
test
"x
$ac_cv_cflags__Wl__Ttext_segment_0x
600
00000
"
=
xyes
then
:
case
$host_os
in
freebsd
*
|
kfreebsd
*
-gnu
)
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-Wl,-Ttext-segment=0x60000000"
;;
*
)
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-Wl,-Ttext-segment=0x7d000000"
;;
esac
as_fn_append WINELOADER_LDFLAGS
" -Wl,-Ttext-segment=0x60000000"
else
$as_nop
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -Wl,--section-start,.interp=0x
7d
000400"
>
&5
printf
%s
"checking whether the compiler supports -Wl,--section-start,.interp=0x
7d
000400... "
>
&6
;
}
if
test
${
ac_cv_cflags__Wl___section_start__interp_0x
7d
000400
+y
}
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -Wl,--section-start,.interp=0x
60
000400"
>
&5
printf
%s
"checking whether the compiler supports -Wl,--section-start,.interp=0x
60
000400... "
>
&6
;
}
if
test
${
ac_cv_cflags__Wl___section_start__interp_0x
60
000400
+y
}
then
:
printf
%s
"(cached) "
>
&6
else
$as_nop
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-Wl,--section-start,.interp=0x
7d
000400"
CFLAGS
=
"
$CFLAGS
-Wl,--section-start,.interp=0x
60
000400"
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__Wl___section_start__interp_0x
7d
000400
=
yes
ac_cv_cflags__Wl___section_start__interp_0x
60
000400
=
yes
else
$as_nop
ac_cv_cflags__Wl___section_start__interp_0x
7d
000400
=
no
ac_cv_cflags__Wl___section_start__interp_0x
60
000400
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.beam
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__Wl___section_start__interp_0x
7d
000400
"
>
&5
printf
"%s
\n
"
"
$ac_cv_cflags__Wl___section_start__interp_0x
7d
000400
"
>
&6
;
}
if
test
"x
$ac_cv_cflags__Wl___section_start__interp_0x
7d
000400
"
=
xyes
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__Wl___section_start__interp_0x
60
000400
"
>
&5
printf
"%s
\n
"
"
$ac_cv_cflags__Wl___section_start__interp_0x
60
000400
"
>
&6
;
}
if
test
"x
$ac_cv_cflags__Wl___section_start__interp_0x
60
000400
"
=
xyes
then
:
case
$host_os
in
freebsd
*
|
kfreebsd
*
-gnu
)
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-Wl,--section-start,.interp=0x60000400"
;;
*
)
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-Wl,--section-start,.interp=0x7d000400"
;;
esac
as_fn_append WINELOADER_LDFLAGS
" -Wl,--section-start,.interp=0x60000400"
fi
fi
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether the compiler supports -Wl,-z,max-page-size=0x1000"
>
&5
printf
%s
"checking whether the compiler supports -Wl,-z,max-page-size=0x1000... "
>
&6
;
}
if
test
${
ac_cv_cflags__Wl__z_max_page_size_0x1000
+y
}
then
:
printf
%s
"(cached) "
>
&6
else
$as_nop
ac_wine_try_cflags_saved
=
$CFLAGS
CFLAGS
=
"
$CFLAGS
-Wl,-z,max-page-size=0x1000"
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__Wl__z_max_page_size_0x1000
=
yes
else
$as_nop
ac_cv_cflags__Wl__z_max_page_size_0x1000
=
no
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.beam
\
conftest
$ac_exeext
conftest.
$ac_ext
CFLAGS
=
$ac_wine_try_cflags_saved
fi
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_cflags__Wl__z_max_page_size_0x1000
"
>
&5
printf
"%s
\n
"
"
$ac_cv_cflags__Wl__z_max_page_size_0x1000
"
>
&6
;
}
if
test
"x
$ac_cv_cflags__Wl__z_max_page_size_0x1000
"
=
xyes
then
:
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-Wl,-z,max-page-size=0x1000"
fi
;;
*
)
WINELOADER_LDFLAGS
=
"
$WINELOADER_LDFLAGS
-pie"
;;
*
)
as_fn_append WINELOADER_LDFLAGS
" -pie"
;;
esac
;;
esac
;;
...
...
configure.ac
View file @
c55578f3
...
...
@@ -769,25 +769,24 @@ case $host_os in
WINE_TRY_CFLAGS([-Wl,-z,defs],[UNIXLDFLAGS="$UNIXLDFLAGS -Wl,-z,defs"])
WINE_TRY_CFLAGS([-Wl,--export-dynamic],[WINELOADER_LDFLAGS="-Wl,--export-dynamic"])
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000"
case $host_cpu in
*i[[3456789]]86* | arm*)
WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],
[case $host_os in
freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x60000000" ;;
*) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-Ttext-segment=0x7d000000" ;;
esac],
[WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7d000400],
[case $host_os in
freebsd* | kfreebsd*-gnu) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x60000400" ;;
*) WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,--section-start,.interp=0x7d000400" ;;
esac])])
WINE_TRY_CFLAGS([-Wl,-z,max-page-size=0x1000],
[WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -Wl,-z,max-page-size=0x1000"])
case $host_os in
linux*)
AS_VAR_APPEND([WINELOADER_LDFLAGS],[" -pie"])
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7d400000"
;;
*)
WINELOADER_LDFLAGS="$WINELOADER_LDFLAGS -pie"
case $HOST_ARCH in
i386|arm)
WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x60000000],
[AS_VAR_APPEND([WINELOADER_LDFLAGS],[" -Wl,-Ttext-segment=0x60000000"])],
[WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x60000400],
[AS_VAR_APPEND([WINELOADER_LDFLAGS],[" -Wl,--section-start,.interp=0x60000400"])])])
;;
*)
AS_VAR_APPEND([WINELOADER_LDFLAGS],[" -pie"])
;;
esac
;;
esac
;;
...
...
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