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

Issue 22923022: Make libnosys function stubs part of libnacl (Closed)

Created:
7 years, 4 months ago by Petr Hosek
Modified:
7 years, 3 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Make libnosys function stubs part of libnacl These functions are already a part of glibc, but in case of newlib developers have to explicitly link against nosys. This change moves all the function stubs to libnacl eliminating this issue. The follow up change should plumb these functions to IRT interfaces to allow overriding these using IRT overlays. The libnosys will be kept around for now as an empty library for backwards compatibility. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3647 TEST= small_tests R=bsy@google.com, mseaborn@chromium.org, sbc@chromium.org Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=12084

Patch Set 1 #

Patch Set 2 : Add dummy file to libnosys to make PNaCl scripts happy #

Patch Set 3 : Move all stub source files into stubs folder #

Total comments: 10

Patch Set 4 : Code review feedback #

Total comments: 3

Patch Set 5 : Code review feedback #

Patch Set 6 : Code review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -1909 lines) Patch
src/untrusted/nacl/nacl.gyp View 1 2 3 2 chunks +75 lines, -0 lines 0 comments Download
src/untrusted/nacl/nacl.scons View 1 2 3 2 chunks +79 lines, -1 line 0 comments Download
src/untrusted/nacl/stubs/_execve.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/access.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/chmod.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/chown.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/endpwent.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/environ.c View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
src/untrusted/nacl/stubs/execl.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/execle.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/execlp.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/execv.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/execve.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/execvp.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fchdir.c View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
src/untrusted/nacl/stubs/fchmod.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fchown.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fcntl.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fdatasync.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fork.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/fsync.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/ftruncate.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/get_current_dir_name.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getegid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/geteuid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getgid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getlogin.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getppid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getpwent.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getpwnam.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getpwnam_r.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getpwuid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getpwuid_r.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getrusage.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getuid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/getwd.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/ioctl.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/isatty.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/issetugid.c View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
src/untrusted/nacl/stubs/kill.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/lchown.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/link.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/llseek.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/lstat.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/pclose.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/pipe.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/popen.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/pselect.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/raise.c View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
src/untrusted/nacl/stubs/readlink.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/remove.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/rename.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/select.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/setegid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/seteuid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/setgid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/setpwent.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/settimeofday.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/setuid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/signal.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/sigprocmask.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/symlink.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/system.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/times.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/tmpfile.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/truncate.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/ttyname.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/ttyname_r.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/umask.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/utime.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/utimes.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/vfork.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/wait.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nacl/stubs/waitpid.c View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
src/untrusted/nosys/_execve.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/access.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/chmod.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/chown.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/endpwent.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/environ.c View 1 chunk +0 lines, -13 lines 0 comments Download
src/untrusted/nosys/execl.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/execle.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/execlp.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/execv.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/execve.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/execvp.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/fchdir.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/fchmod.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/fchown.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/fcntl.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/fdatasync.c View 1 chunk +0 lines, -16 lines 0 comments Download
src/untrusted/nosys/fork.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/fsync.c View 1 chunk +0 lines, -16 lines 0 comments Download
src/untrusted/nosys/ftruncate.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/get_current_dir_name.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/getegid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/geteuid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getgid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getlogin.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/getppid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getpwent.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getpwnam.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getpwnam_r.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getpwuid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getpwuid_r.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getrusage.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getuid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/getwd.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/ioctl.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/isatty.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/issetugid.c View 1 chunk +0 lines, -15 lines 0 comments Download
src/untrusted/nosys/kill.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/lchown.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/link.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/llseek.c View 1 chunk +0 lines, -24 lines 0 comments Download
src/untrusted/nosys/lstat.c View 1 chunk +0 lines, -23 lines 0 comments Download
src/untrusted/nosys/nacl.scons View 1 2 3 1 chunk +3 lines, -74 lines 0 comments Download
src/untrusted/nosys/nosys.gyp View 1 2 3 2 chunks +1 line, -72 lines 0 comments Download
src/untrusted/nosys/pclose.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/pipe.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/popen.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/pselect.c View 1 chunk +0 lines, -25 lines 0 comments Download
src/untrusted/nosys/raise.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/readlink.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/remove.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/rename.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/select.c View 1 chunk +0 lines, -25 lines 0 comments Download
src/untrusted/nosys/setegid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/seteuid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/setgid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/setpwent.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/settimeofday.c View 1 chunk +0 lines, -23 lines 0 comments Download
src/untrusted/nosys/setuid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/signal.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/sigprocmask.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/symlink.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/system.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/times.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/tmpfile.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/truncate.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/ttyname.c View 1 chunk +0 lines, -21 lines 0 comments Download
src/untrusted/nosys/ttyname_r.c View 1 chunk +0 lines, -20 lines 0 comments Download
src/untrusted/nosys/umask.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/utime.c View 1 chunk +0 lines, -23 lines 0 comments Download
src/untrusted/nosys/utimes.c View 1 chunk +0 lines, -23 lines 0 comments Download
src/untrusted/nosys/vfork.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/wait.c View 1 chunk +0 lines, -23 lines 0 comments Download
src/untrusted/nosys/waitpid.c View 1 chunk +0 lines, -22 lines 0 comments Download
src/untrusted/nosys/warning.h View 1 chunk +0 lines, -35 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Petr Hosek
7 years, 4 months ago (2013-08-19 23:24:11 UTC) #1
Mark Seaborn
Hmm, I hadn't considered how many files were involved when we discussed this earlier. I ...
7 years, 4 months ago (2013-08-19 23:42:08 UTC) #2
Sam Clegg
On 2013/08/19 23:42:08, Mark Seaborn wrote: > Hmm, I hadn't considered how many files were ...
7 years, 4 months ago (2013-08-20 00:02:48 UTC) #3
bsy
separate files are desirable for static linkage, so it's traditional to do it that way. ...
7 years, 4 months ago (2013-08-20 23:07:57 UTC) #4
Sam Clegg
lgtm
7 years, 4 months ago (2013-08-21 00:57:33 UTC) #5
Petr Hosek
7 years, 4 months ago (2013-08-23 03:07:44 UTC) #6
Mark Seaborn
Is there an issue you can link to in BUG=? LGTM with changes below. https://codereview.chromium.org/22923022/diff/78001/src/untrusted/nacl/nacl.scons ...
7 years, 4 months ago (2013-08-23 15:45:22 UTC) #7
Petr Hosek
I have created a new issue. https://codereview.chromium.org/22923022/diff/78001/src/untrusted/nacl/nacl.scons File src/untrusted/nacl/nacl.scons (right): https://codereview.chromium.org/22923022/diff/78001/src/untrusted/nacl/nacl.scons#newcode160 src/untrusted/nacl/nacl.scons:160: sources = SRCS_NACL_EXTENSIONS ...
7 years, 4 months ago (2013-08-23 21:35:07 UTC) #8
Sam Clegg
slgtm https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c File src/untrusted/nosys/getegid.c (left): https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c#oldcode22 src/untrusted/nosys/getegid.c:22: stub_warning(getegid); Can you remove all the stub warnings?
7 years, 4 months ago (2013-08-23 21:55:50 UTC) #9
Petr Hosek
https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c File src/untrusted/nosys/getegid.c (left): https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c#oldcode22 src/untrusted/nosys/getegid.c:22: stub_warning(getegid); On 2013/08/23 21:55:51, Sam Clegg wrote: > Can ...
7 years, 4 months ago (2013-08-23 22:34:55 UTC) #10
Sam Clegg
https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c File src/untrusted/nosys/getegid.c (left): https://codereview.chromium.org/22923022/diff/40002/src/untrusted/nosys/getegid.c#oldcode22 src/untrusted/nosys/getegid.c:22: stub_warning(getegid); On 2013/08/23 22:34:56, Petr Hosek wrote: > On ...
7 years, 4 months ago (2013-08-23 22:36:33 UTC) #11
Petr Hosek
Turned out that https://codereview.chromium.org/22903042/ was not enough to make PNaCl happy about the empty archive. ...
7 years, 4 months ago (2013-08-24 03:46:29 UTC) #12
Sam Clegg
On 2013/08/24 03:46:29, Petr Hosek wrote: > Turned out that https://codereview.chromium.org/22903042/ was not enough to ...
7 years, 4 months ago (2013-08-25 16:34:09 UTC) #13
Petr Hosek
On 2013/08/25 16:34:09, Sam Clegg wrote: > On 2013/08/24 03:46:29, Petr Hosek wrote: > > ...
7 years, 3 months ago (2013-08-28 22:51:30 UTC) #14
Petr Hosek
Committed patchset #6 manually as r12084 (presubmit successful).
7 years, 3 months ago (2013-08-29 16:25:29 UTC) #15
jvoung (off chromium)
Are there plans to add getrusage to the newlib headers? This change is now making ...
7 years, 3 months ago (2013-08-29 20:36:35 UTC) #16
Sam Clegg
7 years, 3 months ago (2013-09-04 15:58:24 UTC) #17
Message was sent while issue was closed.
On 2013/08/29 20:36:35, jvoung (cr) wrote:
> Are there plans to add getrusage to the newlib headers?
> 
> 
> This change is now making the PNaCl LLVM self-build detect getrusage as being
> available during the "configure" step.    LLVM then starts trying to compile
> code that uses getrusage.  However, I *think* that because it's not actually
in
> the newlib headers, the compile now fails with:
> 
> 
> 
>
/mnt/data/b/build/slave/linux-pnacl-x86_64/build/native_client/pnacl/git/llvm/lib/Support/Unix/Process.inc:57:5:error:
> no member named 'getrusage' in the global namespace; did you mean 'rusage'?
>   ::getrusage(RUSAGE_SELF, &RU);
>   ~~^
> llvm[1]: Compiling SmallVector.cpp for Release build

Yes, we should be declaring this (and others) in newlibs headers.

Most likely it is already in there guarded by "if CYGWIN || RTEMS".   There are
quite a
few places in the newlib headers where we should (IMHO) add nacl to these
conditional
blocks.  Please open a ticket and assign to me (or Petr).

Powered by Google App Engine
This is Rietveld 408576698