Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ce4dde3e
Commit
ce4dde3e
authored
Aug 17, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegcc: Improve heuristics for -m32/-m64 options in get_lib_dir.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3fa12ba3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
winegcc.c
tools/winegcc/winegcc.c
+35
-12
No files found.
tools/winegcc/winegcc.c
View file @
ce4dde3e
...
...
@@ -448,8 +448,12 @@ static char *get_lib_dir( struct options *opts )
{
static
const
char
*
stdlibpath
[]
=
{
LIBDIR
,
"/usr/lib"
,
"/usr/local/lib"
,
"/lib"
};
static
const
char
libwine
[]
=
"/libwine.so"
;
const
char
*
bit_suffix
,
*
other_bit_suffix
;
unsigned
int
i
;
bit_suffix
=
opts
->
target_cpu
==
CPU_x86_64
||
opts
->
target_cpu
==
CPU_ARM64
?
"64"
:
"32"
;
other_bit_suffix
=
opts
->
target_cpu
==
CPU_x86_64
||
opts
->
target_cpu
==
CPU_ARM64
?
"32"
:
"64"
;
for
(
i
=
0
;
i
<
sizeof
(
stdlibpath
)
/
sizeof
(
stdlibpath
[
0
]);
i
++
)
{
char
*
p
,
*
buffer
=
xmalloc
(
strlen
(
stdlibpath
[
i
])
+
strlen
(
"/arm-linux-gnueabi"
)
+
strlen
(
libwine
)
+
1
);
...
...
@@ -464,18 +468,9 @@ static char *get_lib_dir( struct options *opts )
strcpy
(
p
,
libwine
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
}
if
(
opts
->
target_cpu
!=
CPU_x86_64
&&
opts
->
target_cpu
!=
CPU_ARM64
)
{
strcpy
(
p
,
"32"
);
strcat
(
p
,
libwine
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
}
if
(
opts
->
target_cpu
==
CPU_x86_64
||
opts
->
target_cpu
==
CPU_ARM64
)
{
strcpy
(
p
,
"64"
);
strcat
(
p
,
libwine
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
}
strcpy
(
p
,
bit_suffix
);
strcat
(
p
,
libwine
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
switch
(
opts
->
target_cpu
)
{
case
CPU_x86
:
strcpy
(
p
,
"/i386-linux-gnu"
);
break
;
...
...
@@ -488,6 +483,34 @@ static char *get_lib_dir( struct options *opts )
}
strcat
(
p
,
libwine
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
strcpy
(
buffer
,
stdlibpath
[
i
]
);
p
=
buffer
+
strlen
(
buffer
);
while
(
p
>
buffer
&&
p
[
-
1
]
==
'/'
)
p
--
;
strcpy
(
p
,
libwine
);
/* try to fixup each parent dirs named lib, lib32 or lib64 with target bitness suffix */
while
(
p
>
buffer
)
{
p
--
;
while
(
p
>
buffer
&&
*
p
!=
'/'
)
p
--
;
if
(
*
p
!=
'/'
)
break
;
if
(
memcmp
(
p
+
1
,
"lib"
,
3
))
continue
;
if
(
p
[
4
]
==
'/'
)
{
memmove
(
p
+
6
,
p
+
4
,
strlen
(
p
+
4
)
+
1
);
memcpy
(
p
+
4
,
bit_suffix
,
2
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
memmove
(
p
+
4
,
p
+
6
,
strlen
(
p
+
6
)
+
1
);
}
else
if
(
!
memcmp
(
p
+
4
,
other_bit_suffix
,
2
)
&&
p
[
6
]
==
'/'
)
{
memcpy
(
p
+
4
,
bit_suffix
,
2
);
if
(
check_platform
(
opts
,
buffer
))
goto
found
;
memcpy
(
p
+
4
,
other_bit_suffix
,
2
);
}
}
free
(
buffer
);
continue
;
...
...
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