android / android/ndk

ndk-build can't differentiate between .o files when only the extension has changed

Open
#745 0 comments 1 reaction 0 assignees View on GitHub
bug help wanted ndk-build
Dominant language
No language data
Stars
2.3k
Forks
310
PR merge metrics
No merged PRs in 30d

Description

For the given Android.mk:

```makefile
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := foo
LOCAL_SRC_FILES := foo.c foo.cpp
include $(BUILD_EXECUTABLE)
```

ndk-build replaces the extension with .o rather than appending it, so foo.o will be either the object file for foo.c or foo.cpp depending on who wins the race.

Should be a trivial fix (use foo.c.o and foo.cpp.o instead of foo.o), but it's also low priority. Would be a good bug for an external contributor looking to get started.

Contributor guide

Open the contributing guide

Research direction

Start with the Android.mk example and trace the ndk-build object-file naming rules used for LOCAL_SRC_FILES. Verify the change with both foo.c and foo.cpp, and consider how the build confirms that distinct object files are produced instead of both mapping to foo.o.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c, cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.