[Home]

Summary:ASTERISK-29581: compiler specific extension makes it impossible to compile asterisk on some platforms
Reporter:Andrey (aol-nnov)Labels:
Date Opened:2021-08-16 05:48:37Date Closed:2021-08-16 05:48:39
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Feature Tracker Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm trying to compile Asterisk PBX on a platform that has proprietary gcc-compatible compiler without nested functions support. Also llvm/clang is not available for that platform.

I'm working on a source files preprocessing script that would unnest cleanup functions. But nevertheless it would require changes in original source files too.

I'd like to know if it would be possible to propose such a patch to the mainline?

General idea is to change the RAII_VAR macro as follows:
```
#define RAII_VAR(vartype, varname, initval, dtor)                              \
   vartype varname __attribute__((cleanup(_dtor_ ## varname))) = (initval)
```
and to create additional macro:
```
#define RAII_CLEANUP(vartype, varname, dtor)                              \
   void _dtor_ ## varname (vartype * v) { dtor(*v); }
```

After that, for each source file that contains  RAII_VAR-s generate separate file with RAII_CLEANUP-s for each variable, so, cleanup functions are now un-nested.

Finally, include that generated file into original one.

For example,
some_file.c:
```
#if defined(NO_RAII_SUPPORT)
#include "some.file.c.raii"
#endif

//... later
RAII_VAR(struct sendtext_data *, data, obj, ao2_cleanup);
```
and some_file.c.raii
```
RAII_CLEANUP(struct sendtext_data*, data, ao2_cleanup);
```

So, original source code modifications are minimal and consist of conditionally including a generated file.

Any thoughts are appreciated.
But, generally, I'd like to know if I'm on my own with this modifications or it is possible to include them in the main tree.
Comments:By: Asterisk Team (asteriskteam) 2021-08-16 05:48:38.883-0500

Per the Asterisk versions page [1], the maintenance (bug fix) support for the Asterisk branch you are using has ended. For continued maintenance support please move to a supported branch of Asterisk. After testing with a supported branch, if you find this problem has not been resolved, please open a new issue against the latest version of that Asterisk branch.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions

By: Asterisk Team (asteriskteam) 2021-08-16 05:48:41.747-0500

The severity of this issue has been automatically downgraded from "Blocker" to "Major". The "Blocker" severity is reserved for issues which have been determined to block the next release of Asterisk. This severity can only be set by privileged users. If this issue is deemed to block the next release it will be updated accordingly during the triage process.

By: Asterisk Team (asteriskteam) 2021-08-16 05:48:42.732-0500

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/].

By: Joshua C. Colp (jcolp) 2021-08-16 05:54:17.136-0500

Additionally this would be something to bring up on the asterisk-dev mailing list[1] for discussion. The issue tracker is not a great place for that, because people aren't constantly monitoring it for discussions.

[1] http://lists.digium.com/mailman/admindb/asterisk-dev