New issue
Advanced search Search tips

Issue 799448 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

zlib.h renames the read_buf symbol with a macro

Project Member Reported by brat...@opera.com, Jan 5 2018

Issue description

zlib.h, as a result of the Chromium patch 0001-simd.patch, renames read_buf to Cr_z_read_buf with a macro in names.h. Since read_buf is a common function name in other parts of the code, this will affect those other parts randomly, depending on if zlib.h was included before read_buf was mentioned.

In jumbo build experiments the result was link problems because some //net .h files were included after zlib.h, resulting in references to functions named Cr_z_read_buf(...), while zlib.h wasn't included in the .cc file so the object file contained read_buf(...)

I talked with davidben about this and he recommended changing zlib to not touch read_buf. Since the exposure of read_buf is of our own doing, it's a natural change which doesn't require any new patches.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c709d38a1c6f812da205c03f5448fe4ac5679f3

commit 2c709d38a1c6f812da205c03f5448fe4ac5679f3
Author: Daniel Bratell <bratell@opera.com>
Date: Thu Jan 11 01:01:17 2018

Avoid exporting read_buf renaming from zlib

zlib.h includes a macro that renames read_buf->Cr_z_read_buf. Since
read_buf is a common name in other parts of the code, it causes
some random confusion depending on whether zlib.h has been
included or not.

The renaming macro is a side effect of the 0001-simd.patch that
exposes an internal read_buf method to other files in zlib. This
patch renames read_buf as it is exposed so that it has the less
common name deflate_read_buf.

Bug:  799448 
Change-Id: Icdc4eba973891dfd28d82017415048eded62d577
Reviewed-on: https://chromium-review.googlesource.com/852257
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528512}
[modify] https://crrev.com/2c709d38a1c6f812da205c03f5448fe4ac5679f3/third_party/zlib/deflate.c
[modify] https://crrev.com/2c709d38a1c6f812da205c03f5448fe4ac5679f3/third_party/zlib/fill_window_sse.c
[modify] https://crrev.com/2c709d38a1c6f812da205c03f5448fe4ac5679f3/third_party/zlib/names.h
[modify] https://crrev.com/2c709d38a1c6f812da205c03f5448fe4ac5679f3/third_party/zlib/patches/0001-simd.patch
[modify] https://crrev.com/2c709d38a1c6f812da205c03f5448fe4ac5679f3/third_party/zlib/patches/0005-adler32-simd.patch

Comment 2 by brat...@opera.com, Mar 16 2018

Status: Fixed (was: Started)
Fixed in January by the commit above.

Sign in to add a comment