Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Issue 1743093002: Fix usage with musl libc.

Created:
4 years, 9 months ago by Kylie McClain
Modified:
4 years, 8 months ago
Reviewers:
Mark Seaborn
CC:
chromium-reviews, Markus (顧孟勤), Mark Seaborn
Base URL:
https://chromium.googlesource.com/linux-syscall-support@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix usage with musl libc. BUG=

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix usage with musl libc. #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -23 lines) Patch
M linux_syscall_support.h View 1 2 7 chunks +23 lines, -23 lines 0 comments Download

Messages

Total messages: 14 (1 generated)
Kylie McClain
Ping?
4 years, 9 months ago (2016-03-13 15:36:17 UTC) #1
Mark Seaborn
On 2016/03/13 15:36:17, Kylie McClain wrote: > Ping? FYI, you need to make Rietveld send ...
4 years, 9 months ago (2016-03-13 19:59:49 UTC) #3
KylieMcClain
On 2016/03/13 19:59:49, Mark Seaborn wrote: > On 2016/03/13 15:36:17, Kylie McClain wrote: > > ...
4 years, 9 months ago (2016-03-18 12:45:09 UTC) #4
Kylie McClain
(eh, sorry about that, I logged in from the wrong Google account)
4 years, 9 months ago (2016-03-18 12:48:09 UTC) #5
Mark Seaborn
On 18 March 2016 at 05:45, <huntermcclainer@gmail.com> wrote: > On 2016/03/13 19:59:49, Mark Seaborn wrote: ...
4 years, 9 months ago (2016-03-18 15:11:52 UTC) #6
Kylie McClain
> Defining _GNU_SOURCE in linux_syscall_support.h just doesn't work. You'd > need to define it in ...
4 years, 9 months ago (2016-03-21 19:43:43 UTC) #7
Mark Seaborn
On 21 March 2016 at 12:43, <somasissounds@gmail.com> wrote: > > Defining _GNU_SOURCE in linux_syscall_support.h just ...
4 years, 9 months ago (2016-03-22 19:31:09 UTC) #8
Kylie McClain
> Can you debug this further and figure out why this is turning into a ...
4 years, 8 months ago (2016-04-06 20:48:03 UTC) #9
Mark Seaborn
On 6 April 2016 at 13:48, <somasissounds@gmail.com> wrote: > > Can you debug this further ...
4 years, 8 months ago (2016-04-06 21:16:53 UTC) #10
Kylie McClain
> What's the equivalent output for your Musl toolchain? $ x86_64-pc-linux-musl-cc -Wp,-dD linux_syscall_support.h -E -o ...
4 years, 8 months ago (2016-04-06 21:32:21 UTC) #11
Mark Seaborn
On 6 April 2016 at 14:32, <somasissounds@gmail.com> wrote: > > What's the equivalent output for ...
4 years, 8 months ago (2016-04-06 21:44:24 UTC) #12
Kylie McClain
> Let's get some more context. What is the output with "grep -C 3 pread"? ...
4 years, 8 months ago (2016-04-07 01:20:09 UTC) #13
Mark Seaborn
4 years, 8 months ago (2016-04-07 04:08:44 UTC) #14
On 6 April 2016 at 18:20, <somasissounds@gmail.com> wrote:

> > Let's get some more context. What is the output with "grep -C 3 pread"?
>
>
> $ x86_64-pc-linux-musl-cc -Wp,-dD linux_syscall_support.h -E -o - | grep
> -C 3
>

OK, thanks for checking.

I presume linux_syscall_support.h works OK on its own then.  It just fails
when #included in the context of compiling
src/client/linux/crash_generation/crash_generation_client.cc from Breakpad,
right?  So you can try the same "-Wp,-dD -E" + grep with that Breakpad file
and it should show the source of the problem.

Having looked into it, I think the cause is this:

glibc does this, which works OK:
/usr/include/unistd.h:#   define pread pread64

But Musl has the #define the other way around:
include/unistd.h:#define pread64 pread

So linux_syscall_support.h's reference to __NR_##pread64 ends up being
turned into __NR_pread.

I'm not sure whether it's OK for Musl to be doing that #define (or glibc
either for that matter).  Maybe Musl could be changed to define pread64()
as an inline function that calls pread(), or as an alias using
__attribute__((alias))?

Cheers,
Mark

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698