Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDK 19-beta1: libvpx error: argument unused during compilation: '-stdlib=libc++' #849

Closed
aberaud opened this issue Nov 17, 2018 · 10 comments
Assignees
Labels
for-beta2 Bugs that should be fixed in time for beta 2.
Milestone

Comments

@aberaud
Copy link

aberaud commented Nov 17, 2018

Error when configuring libvpx with NDK 19-beta1 with a standalone toolchain:

from config.log:

check_cflags -march=armv7-a -mfloat-abi=softfp
check_cc -Werror -march=armv7-a -mfloat-abi=softfp
BEGIN /tmp/vpx-conf-18897-6252.c
     1	int x;
END /tmp/vpx-conf-18897-6252.c
android-toolchain-19-arm/bin/arm-linux-androideabi-clang -Icontrib/arm-linux-androideabi/include -DNDEBUG=1 -O3 -march=armv7-a -mthumb -mfloat-abi=softfp -mfpu=vfpv3-d16 -DNDEBUG -fPIC -fno-integrated-as -fPIC -Werror -march=armv7-a -mfloat-abi=softfp -c -o /tmp/vpx-conf-18897-6252.o /tmp/vpx-conf-18897-6252.c
clang80: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument]

Removing -stdlib=libc++ from forced flags at make_standalone_toolchain.py:125 made it build.

@aberaud
Copy link
Author

aberaud commented Nov 17, 2018

It also produces warnings when building other C projects (it fails with vpx because of -Werror).

Looks like this C++-specific flag shouldn't be used when not building C++ code.

@DanAlbert
Copy link
Member

I've already solved this the right way upstream (changing Clang's default -stdlib for Android), but that doesn't help us for r19.

I think I probably do need to do something here. It's probably going to be a gross hack, but we shouldn't regress this behavior in r19 if it can be avoided.

@DanAlbert DanAlbert self-assigned this Nov 27, 2018
@DanAlbert DanAlbert added this to the r19 milestone Nov 27, 2018
@DanAlbert DanAlbert added the for-beta2 Bugs that should be fixed in time for beta 2. label Nov 27, 2018
@DanAlbert
Copy link
Member

Actually this is super simple: https://android-review.googlesource.com/c/platform/ndk/+/836405

@DanAlbert
Copy link
Member

Fixed for beta 2. Thanks for the report!

@DanAlbert
Copy link
Member

Crap, only half of this was actually cherry-picked. Beta 2 was still broken an now so is stable. Will be a part of r19b.

@DanAlbert DanAlbert reopened this Jan 16, 2019
@DanAlbert
Copy link
Member

@epicstar
Copy link

I noticed that r19 is out (stable) but this is still open. So did this make the r19 stable build, or will we have to wait for r19b? Thanks all.

@DanAlbert
Copy link
Member

Read the previous two comments.

@aberaud
Copy link
Author

aberaud commented Feb 11, 2019

Hi,
When is r19b planned to be released ?
Thanks

@DanAlbert
Copy link
Member

I'm staging a release candidate right now. We'll need to wait for QA to have room in their schedule (sometime this week, last I heard) and I have a bit more testing of my own to do. Once that's done, it goes live. Should be this week.

disigma pushed a commit to wimal-build/ndk that referenced this issue Feb 22, 2019
Fix Windows...

Test: Inspect Linux *and* Windows scripts
Bug: android/ndk#849
Change-Id: Ica2c11d147c0d254150196655be520448ecb90ee
(cherry picked from commit 716ba14)
disigma pushed a commit to wimal-build/ndk that referenced this issue Feb 22, 2019
Test: Manual inspection of build flags with `clang -v`
Bug: android/ndk#849
Change-Id: Ibdb2254ee9e91f94c59c8c9c794b19ae617ef6d2
(cherry picked from commit dc2cc5f)
disigma pushed a commit to wimal-build/ndk that referenced this issue Feb 22, 2019
Test: None
Bug: android/ndk#849
Change-Id: I770024162863e3a3a5ccebcefdebf8da43b031a4
grendello added a commit to grendello/xamarin-android that referenced this issue Mar 12, 2019
`cmake` 3.10 is the current version of the tool in the Android SDK,
an update from the much older 3.6. This update brings it closer to
the host `cmake` versions (currently mostly 3.12.*)

Bump NDK to release [19b][0] (a.k.a. 19.1), with the following changes:

    * [Issue 855][1]: ndk-build automatically disables multithreaded
      linking for LLD on Windows, where it may hang. It is not
      possible for the NDK to detect this situation for CMake,
      so CMake users and custom build systems must pass
      `-Wl,--no-threads` when linking with LLD on Windows.
    * [Issue 849][2]: Fixed unused command line argument warning when
      using standalone toolchains to compile C code.
    * [Issue 890][3]: Fixed CMAKE_FIND_ROOT_PATH. CMake projects will
      no longer search the host's sysroot for headers and libraries.
    * [Issue 907][4]: Fixed find_path for NDK headers in CMake.

[0]: https://github.com/android-ndk/ndk/wiki/Changelog-r19#r19b
[1]: android/ndk#855
[2]: android/ndk#849
[3]: android/ndk#890
[4]: android/ndk#907
grendello added a commit to grendello/xamarin-android that referenced this issue Mar 12, 2019
`cmake` 3.10 is the current version of the tool in the Android SDK,
an update from the much older 3.6. This update brings it closer to
the host `cmake` versions (currently mostly 3.12.*)

Bump NDK to release [19b][0] (a.k.a. 19.1), with the following changes:

  * [Issue 855][1]: ndk-build automatically disables multithreaded
    linking for LLD on Windows, where it may hang. It is not
    possible for the NDK to detect this situation for CMake,
    so CMake users and custom build systems must pass
    `-Wl,--no-threads` when linking with LLD on Windows.
  * [Issue 849][2]: Fixed unused command line argument warning when
    using standalone toolchains to compile C code.
  * [Issue 890][3]: Fixed CMAKE_FIND_ROOT_PATH. CMake projects will
    no longer search the host's sysroot for headers and libraries.
  * [Issue 907][4]: Fixed find_path for NDK headers in CMake.

[0]: https://github.com/android-ndk/ndk/wiki/Changelog-r19#r19b
[1]: android/ndk#855
[2]: android/ndk#849
[3]: android/ndk#890
[4]: android/ndk#907
jonpryor pushed a commit to dotnet/android that referenced this issue Mar 13, 2019
`cmake` 3.10 is the current version of the tool in the Android SDK,
an update from the much older 3.6.  This update brings it closer to
the host `cmake` versions (currently mostly 3.12.*)

Bump NDK to release [19b][0] (a.k.a. 19.1), which changes:

  * [Issue 855][1]: ndk-build automatically disables multithreaded
    linking for LLD on Windows, where it may hang.  It is not
    possible for the NDK to detect this situation for CMake,
    so CMake users and custom build systems must pass
    `-Wl,--no-threads` when linking with LLD on Windows.
  * [Issue 849][2]: Fixed unused command line argument warning when
    using standalone toolchains to compile C code.
  * [Issue 890][3]: Fixed CMAKE_FIND_ROOT_PATH.  CMake projects will
    no longer search the host's sysroot for headers and libraries.
  * [Issue 907][4]: Fixed find_path for NDK headers in CMake.

[0]: https://github.com/android-ndk/ndk/wiki/Changelog-r19#r19b
[1]: android/ndk#855
[2]: android/ndk#849
[3]: android/ndk#890
[4]: android/ndk#907
mingchen added a commit to mingchen/docker-android-build-box that referenced this issue Jul 22, 2019
Upgrade NDK from r19 to r20.

Addressed NDK r19 issue: android/ndk#849
mehulagg pushed a commit to mehulagg/superproject that referenced this issue Dec 21, 2019
* Update ndk from branch 'ndk-release-r19'
  to 8978a0899f16f2a2221964dda1159be1f20e8e49
  - Merge "Fix the make_standalone_toolchain stdlib fix." into ndk-release-r19
  - Fix the make_standalone_toolchain stdlib fix.
    
    Fix Windows...
    
    Test: Inspect Linux *and* Windows scripts
    Bug: android/ndk#849
    Change-Id: Ica2c11d147c0d254150196655be520448ecb90ee
    (cherry picked from commit 716ba14de9aeac231783a9e7d405d76cdd2f75cc)
mehulagg pushed a commit to mehulagg/superproject that referenced this issue Dec 21, 2019
* Update ndk from branch 'ndk-release-r19'
  to 1904f74db06e44e280e4ac977f0e5a212527e3a0
  - Merge changes I77002416,Ibdb2254e,I5cb7b38f into ndk-release-r19
    
    * changes:
      Update changelog to mention fix in r19b.
      Only use -stdlib=libc++ with clang++.
      Now r19b canary.
    
  - Update changelog to mention fix in r19b.
    
    Test: None
    Bug: android/ndk#849
    Change-Id: I770024162863e3a3a5ccebcefdebf8da43b031a4
    
  - Only use -stdlib=libc++ with clang++.
    
    Test: Manual inspection of build flags with `clang -v`
    Bug: android/ndk#849
    Change-Id: Ibdb2254ee9e91f94c59c8c9c794b19ae617ef6d2
    (cherry picked from commit dc2cc5f94756878c2ae214f47988bed1302aef5b)
    
  - Now r19b canary.
    
    Test: ./checkbuild.py
    Bug: None
    Change-Id: I5cb7b38f4bff55f1ebe50d5f03aa2481b3fe85c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for-beta2 Bugs that should be fixed in time for beta 2.
Projects
None yet
Development

No branches or pull requests

3 participants