Public bug reported:

asterisk fails to build from source on riscv64 in Ubuntu stonking.

== References ==

PPA build log: https://launchpad.net/~hectorcao/+archive/ubuntu/net-
snmp-transition/+build/32908397

** Affects: asterisk (Ubuntu)
     Importance: Undecided
     Assignee: Hector CAO (hectorcao)
         Status: New


** Tags: ftbfs riscv64 stonking

** Changed in: asterisk (Ubuntu)
     Assignee: (unassigned) => Hector CAO (hectorcao)

** Description changed:

  asterisk fails to build from source on riscv64 in Ubuntu stonking.
- 
- == Build Error ==
- 
- The build fails with a misleading "No such file or directory" error for
- output/pjmedia-riscv64-unknown-linux-gnu/alaw_ulaw.o, which is a downstream
- consequence of the actual root cause: a compilation failure in pjlib that is
- hidden by output redirection (>/dev/null) in the pjproject build system.
- 
- The actual error visible in the log is:
- 
- ../src/pj/pool.c:186:19: warning: initialization discards 'const' qualifier
-   from pointer target type [-Wdiscarded-qualifiers]
-   186 |         char *p = pj_ansi_strchr(name, '%');
-       |                   ^~~~~~~~~~~~~~
- 
- This warning is treated as an error (-Werror) causing the pjmedia build to
- fail, which in turn causes the missing output directory error.
- 
- == Root Cause ==
- 
- pj_ansi_strchr is defined as a macro mapping to strchr():
- 
-   #define pj_ansi_strchr  strchr
- 
- glibc now provides const-preserving overloads of strchr():
- 
-   extern char *strchr (char *__s, int __c);
-   extern const char *strchr (const char *__s, int __c);
- 
- In pjlib/src/pj/pool.c, pj_pool_init_int() accepts a `const char *name`
- argument. Assigning pj_ansi_strchr(name, '%') to `char *p` discards the
- const qualifier, which is rejected by -Werror=discarded-qualifiers.
- 
- The pointer `p` is only read (never written through), so declaring it as
- `const char *p` is the correct fix.
- 
- == Fix ==
- 
- --- a/Xpjproject/pjlib/src/pj/pool.c
- +++ b/Xpjproject/pjlib/src/pj/pool.c
- @@ -183,7 +183,7 @@ PJ_DEF(void) pj_pool_init_int(pj_pool_t *pool,
-      if (name) {
- -        char *p = pj_ansi_strchr(name, '%');
- +        const char *p = pj_ansi_strchr(name, '%');
  
  == References ==
  
  PPA build log: https://launchpad.net/~hectorcao/+archive/ubuntu/net-
  snmp-transition/+build/32908397

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2154433

Title:
  asterisk: FTBFS on riscv64 - const qualifier discarded in pjlib pool.c

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/asterisk/+bug/2154433/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to