daiyanbao / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

ARM64 iOS build error iossim.mm:480:9: error: variable 'path' #548

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
[9/20] CXX obj/unit_test/libyuv_unittest.version_test.o
FAILED: /b/build/goma/gomacc 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF 
obj.host/chromium/src/testing/iossim/iossim.iossim.o.d 
-DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DDISABLE_NACL -DCHROMIUM_BUILD 
-DCR_CLANG_REVISION=256316-1 -DUSE_LIBJPEG_TURBO=1 -DDONT_EMBED_BUILD_METADATA 
-DDCHECK_ALWAYS_ON=1 -DFIELDTRIAL_TESTING_ENABLED -DDISABLE_FTP_SUPPORT=1 
-DV8_USE_EXTERNAL_STARTUP_DATA -DUSE_LIBPCI=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen 
-Iobj.host/chromium/src/testing/iossim/iossim.gen/iossim -isysroot 
/Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Develo
per/SDKs/MacOSX10.10.sdk -O0 -Werror -mmacosx-version-min=10.9 -arch x86_64 
-Wall -Wno-unused-parameter -Wno-missing-field-initializers 
-Wno-selector-type-mismatch -Wheader-hygiene -Wfor-loop-analysis 
-Wno-char-subscripts -Wno-unneeded-internal-declaration 
-Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing 
-Wno-deprecated-register -Wno-inconsistent-missing-override 
-Wno-shift-negative-value -Wno-unused-variable -Wno-deprecated-declarations 
-std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden 
-fno-threadsafe-statics -Xclang -load -Xclang 
/b/build/slave/mac64/build/src/third_party/llvm-build/Release+Asserts/lib/libFin
dBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang 
-plugin-arg-find-bad-constructs -Xclang check-templates -fcolor-diagnostics 
-fstack-protector-all -fobjc-call-cxx-cdtors  -c 
../../chromium/src/testing/iossim/iossim.mm -o 
obj.host/chromium/src/testing/iossim/iossim.iossim.o
../../chromium/src/testing/iossim/iossim.mm:480:9: error: variable 'path' is 
used uninitialized whenever 'if' condition is true 
[-Werror,-Wsometimes-uninitialized]
    if (IsRunningWithXcode6OrLater()) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../chromium/src/testing/iossim/iossim.mm:494:39: note: uninitialized use 
occurs here
    if ([fileManager fileExistsAtPath:path]) {
                                      ^~~~
../../chromium/src/testing/iossim/iossim.mm:480:5: note: remove the 'if' if its 
condition is always false
    if (IsRunningWithXcode6OrLater()) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../chromium/src/testing/iossim/iossim.mm:479:19: note: initialize the 
variable 'path' to silence this warning
    NSString* path;
                  ^
                   = nil
1 error generated.
ninja: build stopped: subcommand failed.

Original issue reported on code.google.com by fbarch...@google.com on 19 Jan 2016 at 6:30

GoogleCodeExporter commented 8 years ago
That's odd. Neither iossim.m or iossim.gyp shows any recent change, so I wonder 
how this can work for Chromium (or WebRTC for that matter, since we also build 
ARM64, and use this library). 

Can you provide details on exact reproduction steps? What version of Xcode do 
you have?

+smut in case this is a known issue. Just disabling the warning in iossim.gyp 
seems like the easiest solution (but has to be done in Chromium's src repo).

Original comment by kjellan...@google.com on 19 Jan 2016 at 8:09

GoogleCodeExporter commented 8 years ago
My local ios builds are working, for native 32 and 64 bit ARM, and Intel 
simulator.
I'm on xcode 6.4 (6e35b)

Original comment by fbarch...@google.com on 20 Jan 2016 at 12:24

GoogleCodeExporter commented 8 years ago
OK. I don't know how old the version is on the bots, but I filed 
https://code.google.com/p/chromium/issues/detail?id=579424 requesting upgrade 
to Xcode 7, since that's what we have in WebRTC, and we don't hit this error.

Original comment by kjellan...@google.com on 20 Jan 2016 at 8:42

GoogleCodeExporter commented 8 years ago
Updating the bots didn't help 
(https://code.google.com/p/chromium/issues/detail?id=579424). 
I can take a look at bisecting the changes in the roll interval:
https://chromium.googlesource.com/chromium/src/+log/dad6346..70ee602b6

Something in there must have broken compilation.

Original comment by kjellander@chromium.org on 21 Jan 2016 at 9:50

GoogleCodeExporter commented 8 years ago
The following revision refers to this bug:
  https://chromium.googlesource.com/libyuv/libyuv.git/+/a4288dd6dc59e34d2625ceff1cd72875b0c9b14f

commit a4288dd6dc59e34d2625ceff1cd72875b0c9b14f
Author: Henrik Kjellander <kjellander@webrtc.org>
Date: Thu Jan 21 12:07:35 2016

Disable sometimes-uninitialized Clang warning for iOS

This works around a compile problem with iossim.mm.

BUG=libyuv:548
TBR=fbarchard@chromium.org

Review URL: https://codereview.chromium.org/1611123004 .

[modify] 
http://crrev.com/a4288dd6dc59e34d2625ceff1cd72875b0c9b14f/libyuv_test.gyp

Original comment by bugdroid1@chromium.org on 21 Jan 2016 at 12:07

GoogleCodeExporter commented 8 years ago
The workaround in #5 disables the warning. I don't know why we don't see the 
same problem in WebRTC though (or Chromium for that matter).

Marking this as fixed since it is from libyuv's perspective at least.

Original comment by kjellan...@google.com on 21 Jan 2016 at 12:08