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

i added decorations to code #104

Closed
wants to merge 3 commits into from
Closed

Conversation

salihberat
Copy link
Contributor

@salihberat salihberat commented Jan 3, 2025

according to ChatGPT:
Removed -mssse3, -msse4.2, and -mpopcnt:

These flags are not needed when using -march or -mtune.
Both -march=native (if used) and -mtune=native automatically detect and enable relevant instruction sets based on the target CPU.

Kept -m32 for 32-bit builds (CFLAGS_x86):

This is required for explicitly targeting 32-bit systems.

Kept -march for architecture specification:

-march=i686 ensures compatibility with i686 systems for 32-bit builds.
-march=x86-64 ensures compatibility with 64-bit x86 systems.

Why -mtune=native Is Better in This Case

Using -mtune=native ensures that the generated code is tuned for the exact machine where it is compiled, potentially yielding better performance compared to the generic -mtune=intel. -------------

I DID NOT TEST THIS CODE!!!

trholding and others added 3 commits January 3, 2025 03:52
When building with SDK 34 the following error occurs on devices that need older SDKs:

```
Failure [INSTALL_FAILED_OLDER_SDK: Requires newer sdk version cnlohr#34 (current version is cnlohr#33)]
Performing Streamed Install
adb: failed to install cnfgtest.apk: Failure [INSTALL_FAILED_OLDER_SDK: Requires newer sdk version cnlohr#34 (current version is cnlohr#33)]
make: *** [Makefile:191: push] Error 1
```

This is resolved by setting ANDROIDVERSION=29 in the AndroidManifest.xml target which sets android:minSdkVersion to the lowest SDK version supported by rawdrawandroid.
When building the  x86 and / or x86_64 target(s) with SDK 34 and NDK 28.0.12674087, the following error occurs:

```error: unknown target CPU 'intel'
note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3, i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3, pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott, nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, raptorlake, meteorlake, arrowlake, arrowlake-s, lunarlake, gracemont, pantherlake, sierraforest, grandridge, graniterapids, graniterapids-d, emeraldrapids, clearwaterforest, knl, knm, lakemont, k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, znver4, x86-64, geode
make: *** [Makefile:138: makecapk/lib/x86/libcnfgtest.so] Error 1```

The fix is to omit  -mtune flag or set -mtune=generic where generic is a better choice.
I should was first edit this, my mistake
i saw your code and edited Charles's project
@cnlohr
Copy link
Owner

cnlohr commented Jan 3, 2025

We should not hard code SDK versions in this location ANDROIDVERSION=$(ANDROIDVERSION). We could make a new variable and set it there. I am still a little confused why so many PRs on this front. Please try to get this down to one PR, with as few changes as possible.

@cnlohr cnlohr closed this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants