Azure / Azure/azure-c-shared-utility

Building on ARM64 shows "target architecture: GENERIC"

Open
#615 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
116
Forks
216
Avg merge
2d 3h
Merged PRs (30d)
11

Description

here's why GENERIC is showing. azure c isn't detecting ARM64: azure_c_shared_utility\azure_iot_build_rules.cmake has:

```
if (MSVC)
    detect_architecture("_M_AMD64" x86_64)
    detect_architecture("_M_IX86" x86)
    detect_architecture("_M_ARM" ARM)
else()
    detect_architecture("__x86_64__" x86_64)
    detect_architecture("__i386__" x86)
    detect_architecture("__arm__" ARM)
endif()
if (NOT DEFINED ARCHITECTURE OR ARCHITECTURE STREQUAL "")
    set(ARCHITECTURE "GENERIC")
endif()
message(STATUS "target architecture: ${ARCHITECTURE}")
```

`_M_ARM`: Defined as the integer literal value 7 for compilations that target ARM processors. Undefined for ARM64, ARM64EC, and other targets.

This should also have a check for:

`_M_ARM64`: Defined as 1 for compilations that target ARM64. Otherwise, undefined.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in azure_c_shared_utility\azure_iot_build_rules.cmake and inspect the existing MSVC and non-MSVC architecture checks. Verify the expected compiler macro for ARM64, then confirm that an ARM64 build reports the specific architecture instead of GENERIC; test the relevant CMake configuration on an ARM64 environment if available.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.