[asterisk-bugs] [JIRA] (ASTERISK-29583) [patch] BuildSystem: User CFLAGS should always have the last say.

Asterisk Team (JIRA) noreply at issues.asterisk.org
Mon Aug 16 10:53:33 CDT 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=255849#comment-255849 ] 

Asterisk Team commented on ASTERISK-29583:
------------------------------------------

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

> [patch] BuildSystem: User CFLAGS should always have the last say.
> -----------------------------------------------------------------
>
>                 Key: ASTERISK-29583
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29583
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/BuildSystem
>    Affects Versions: 16.20.0, 18.6.0
>            Reporter: Alexander Traud
>            Severity: Major
>              Labels: patch
>         Attachments: user_cflags_last.patch
>
>
> The manual for {{automake}}, which creates the script {{./configure}}, [states|https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html]: ‘Users should always have the last say.’ However, while investigating a workaround for ASTERISK-29576, I found this issue:{code}CFLAGS='-Wno-error=format-nonliteral' ./configure --enable-dev-mode=noisy{code}
> has to prevent the failure of the build because the only remaining warning, which the developer mode turned into an error, gets disabled. Normally. Alternatively
> {code}ASTCFLAGS='-Wno-error=format-nonliteral' make{code}
> has to do the trick as well.
> However, the current build system puts the user-supplied {{CFLAGS}} not at the end but the very front. Actually, the ones from the script {{./configure}} are copied over into the variable {{CONFIG_CFLAGS}}, which gets the first part of the {{_ASTCFLAGS}} (note the underscore). Much later, {{-Wformat=2}} is appended to {{_ASTCFLAGS}}, which is a [shorthand|https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html] for several warnings including {{-Wformat-nonliteral}}. Therefore, my supplied {{CFLAGS}} get overwritten. Therefore, the error is not turned into a warning. Therefore, the build still fails.
> The attached patch fixes this and puts the {{CFLAGS}} from the script {{./configure}} second last. The {{ASTCFLAGS}} from {{make}} last. Furthermore, it reverts Commit [f1bc280|https://github.com/asterisk/asterisk/commit/f1bc2809b1c3f08c569f4be3af916fb64541ad0d], which fixed Mantis 16685 (now ASTERISK-15501) because the attached patch is considered the correct way of fixing it.
> If you read this here and it broke your script, please, double-check whether you assumed an incorrect behavior. If your script assumed it, double-check if there is no correct way of doing it. If there is no such way, create a new issue and ask the ‘Bug Marshals’ to link this one here (caused-by). I am just an external contributor. That way, I am notified about the introduced issue and might be able to help.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list