Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(104)

Issue 106240043: Fix clang compilation errors in libelf.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by simonb1
Modified:
10 years, 11 months ago
Reviewers:
thakis, rmcilroy
Base URL:
https://chromium.googlesource.com/external/elfutils.git@master
Visibility:
Public.

Description

Fix clang compilation errors in libelf. Remove use of VLA inside a union/struct. Replace nested functions with local static functions. Fixes: third_party/elfutils/src/libelf/elf32_updatefile.c:294:4: error: function definition is not allowed here third_party/elfutils/src/libelf/elf32_updatefile.c:328:7: error: implicit declaration of function 'fill_mmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration] third_party/elfutils/src/libelf/elf_getarsym.c:201:15: error: fields must have a constant size: 'variable length array in structure' extension will never be supported third_party/elfutils/src/libelf/elf_getarsym.c:202:15: error: fields must have a constant size: 'variable length array in structure' extension will never be supported third_party/elfutils/src/libelf/elf_begin.c:1015:3: error: function definition is not allowed here third_party/elfutils/src/libelf/elf_begin.c:1047:11: error: implicit declaration of function 'lock_dup_elf' is invalid in C99 [-Werror,-Wimplicit-function-declaration] BUG=385553

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -50 lines) Patch
M libelf/elf32_updatefile.c View 1 4 chunks +30 lines, -23 lines 0 comments Download
M libelf/elf_begin.c View 4 chunks +18 lines, -15 lines 0 comments Download
M libelf/elf_getarsym.c View 4 chunks +13 lines, -12 lines 0 comments Download

Messages

Total messages: 7
simonb1
11 years, 10 months ago (2014-06-27 15:10:12 UTC) #1
rmcilroy
Please add a patch file which can be used to re-apply this change, and update ...
11 years, 10 months ago (2014-06-27 15:24:26 UTC) #2
simonb1
Fix uploaded in patch set 2. Ptal, thanks. https://codereview.appspot.com/106240043/diff/1/libelf/elf32_updatefile.c File libelf/elf32_updatefile.c (right): https://codereview.appspot.com/106240043/diff/1/libelf/elf32_updatefile.c#newcode389 libelf/elf32_updatefile.c:389: scn_start, ...
11 years, 10 months ago (2014-06-27 15:52:57 UTC) #3
rmcilroy
lgtm.
11 years, 10 months ago (2014-06-27 16:30:16 UTC) #4
thakis
was this sent upstream in some way?
10 years, 11 months ago (2015-05-05 15:56:08 UTC) #5
simonb1
On 2015/05/05 15:56:08, thakis wrote: > was this sent upstream in some way? No. It ...
10 years, 11 months ago (2015-05-06 14:38:35 UTC) #6
thakis
10 years, 11 months ago (2015-05-07 19:41:27 UTC) #7
On 2015/05/06 14:38:35, simonb1 wrote:
> On 2015/05/05 15:56:08, thakis wrote:
> > was this sent upstream in some way?
> 
> No.  It only addresses the needed libelf (and even then only for the required
> functions inside it), and so is not a full elfutils patch.  Elfutils contains
> other libraries.  An elfutils patch suitable for acceptance upstream would
> require clang fixes to all elfutils libraries.
> 
> Prior discussion on this topic:
> https://code.google.com/p/chromium/issues/detail?id=217722#c5
> 
> "nested functions tend to be the worse thing to try and make work under clang.

> upstream packages aren't generally interested in reworking the code (because
> usually it's embedded pretty far), and clang isn't interested in adding
support
> for the feature."

Have you asked upstream if they'd be interested in the patch?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b