macports-ports icon indicating copy to clipboard operation
macports-ports copied to clipboard

cdecl: update to 11.15

Open barracuda156 opened this issue 2 years ago • 17 comments

Description

Update to 11.15.

Type(s)
  • [ ] bugfix
  • [x] enhancement
  • [ ] security fix
Tested on

macOS 10.6.8 Server Xcode 3.2.6

macOS 10.6 PPC (10A190) Xcode 3.2 (Test suite: all 1622 tests pass successfully, 0 fails.)

macOS 10.5.8 Xcode 3.1.4 (Confirmed universal build.)

Verification

Have you

  • [x] followed our Commit Message Guidelines?
  • [x] squashed and minimized your commits?
  • [x] checked that there aren't other open pull requests for the same change?
  • [ ] referenced existing tickets on Trac with full URL?
  • [x] checked your Portfile with port lint --nitpick?
  • [x] tried existing tests with sudo port test?
  • [ ] tried a full install with sudo port -vst install?
  • [ ] tested basic functionality of all binary files?

barracuda156 avatar May 19 '22 20:05 barracuda156

Notifying maintainers: @paul-j-lucas for port cdecl.

macportsbot avatar May 19 '22 20:05 macportsbot

Let me add muniversal PG, it actually builds as +universal on Leopard.

barracuda156 avatar May 19 '22 21:05 barracuda156

P. S. To make it explicit, added Rosetta fix is actually for Rosetta. On 10.6 PPC cdecl builds without it, however on 10.6.8 Rosetta the build fails due to Macports pulling clang:

slist.h: At top level:
slist.h:88: error: redefinition of typedef ‘slist_t’
types.h:58: error: previous declaration of ‘slist_t’ was here
slist.h:89: error: redefinition of typedef ‘slist_node_t’
types.h:59: error: previous declaration of ‘slist_node_t’ was here
In file included from c_ast.h:36,
                 from c_ast.c:31:
c_sname.h: In function ‘c_sname_first_type’:
c_sname.h:389: warning: cast from pointer to integer of different size
c_sname.h:389: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_local_type’:
c_sname.h:405: warning: cast from pointer to integer of different size
c_sname.h:405: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_first_type’:
c_sname.h:554: warning: cast from pointer to integer of different size
c_sname.h:554: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_local_type’:
c_sname.h:570: warning: cast from pointer to integer of different size
c_sname.h:570: warning: cast to pointer from integer of different size
In file included from pjl_config.h:74,
                 from lexer.l:36:
config.h:1086:1: warning: "_GL_ATTRIBUTE_FORMAT" redefined
In file included from lexer.c:18:
../lib/stdio.h:114:1: warning: this is the location of the previous definition
In file included from pjl_config.h:74,
                 from lexer.l:36:
config.h:1106:1: warning: "_GL_ATTRIBUTE_MALLOC" redefined
In file included from lexer.c:19:
../lib/string.h:94:1: warning: this is the location of the previous definition
In file included from pjl_config.h:74,
                 from lexer.l:36:
config.h:1217:1: warning: "_GL_ATTRIBUTE_PURE" redefined
In file included from lexer.c:19:
../lib/string.h:104:1: warning: this is the location of the previous definition
c_ast.c: In function ‘c_ast_dup’:
c_ast.c:145: warning: cast from pointer to integer of different size
c_ast.c:145: warning: cast to pointer from integer of different size
In file included from c_lang.h:34,
                 from c_type.h:32,
                 from c_sname.h:41,
                 from c_ast.h:36,
                 from c_ast_check.c:29:
util.h: In function ‘fprint_sep’:
util.h:922: warning: passing argument 1 of ‘perror_exit_if’ with different width due to prototype
In file included from c_type.h:32,
                 from c_sname.h:41,
                 from c_ast.h:36,
                 from c_ast_check.c:29:
c_lang.h: In function ‘c_lang_and_newer’:
c_lang.h:807: warning: passing argument 1 of ‘exactly_one_bit_set’ with different width due to prototype
c_ast.c: In function ‘c_ast_free’:
c_ast.c:297: warning: cast from pointer to integer of different size
c_ast.c:297: warning: cast to pointer from integer of different size
c_ast.c: In function ‘c_ast_new’:
c_ast.c:309: warning: passing argument 1 of ‘exactly_one_bit_set’ with different width due to prototype
c_lang.h: In function ‘c_lang_newer’:
c_lang.h:921: warning: passing argument 1 of ‘exactly_one_bit_set’ with different width due to prototype
In file included from c_sname.h:42,
                 from c_ast.h:36,
                 from parser.y:36:
slist.h: At top level:
slist.h:88: error: redefinition of typedef ‘slist_t’
types.h:58: error: previous declaration of ‘slist_t’ was here
slist.h:89: error: redefinition of typedef ‘slist_node_t’
types.h:59: error: previous declaration of ‘slist_node_t’ was here
In file included from c_ast.h:36,
                 from parser.y:36:
c_sname.h: In function ‘c_sname_first_type’:
c_sname.h:389: warning: cast from pointer to integer of different size
c_sname.h:389: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_local_type’:
c_sname.h:405: warning: cast from pointer to integer of different size
c_sname.h:405: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_first_type’:
c_sname.h:554: warning: cast from pointer to integer of different size
c_sname.h:554: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_local_type’:
c_sname.h:570: warning: cast from pointer to integer of different size
c_sname.h:570: warning: cast to pointer from integer of different size
In file included from c_sname.h:42,
                 from c_ast.h:36,
                 from c_ast_check.c:29:
slist.h: At top level:
slist.h:88: error: redefinition of typedef ‘slist_t’
types.h:58: error: previous declaration of ‘slist_t’ was here
slist.h:89: error: redefinition of typedef ‘slist_node_t’
types.h:59: error: previous declaration of ‘slist_node_t’ was here
In file included from c_lang.h:34,
                 from c_type.h:32,
                 from c_sname.h:41,
                 from c_ast.h:36,
                 from lexer.l:38:
util.h: In function ‘fprint_sep’:
util.h:922: warning: passing argument 1 of ‘perror_exit_if’ with different width due to prototype
In file included from c_type.h:32,
                 from c_sname.h:41,
                 from c_ast.h:36,
                 from lexer.l:38:
c_lang.h: In function ‘c_lang_and_newer’:
c_lang.h:807: warning: passing argument 1 of ‘exactly_one_bit_set’ with different width due to prototype
In file included from c_ast.h:36,
                 from c_ast_check.c:29:
c_sname.h: In function ‘c_sname_first_type’:
c_sname.h:389: warning: cast from pointer to integer of different size
c_sname.h:389: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_local_type’:
c_sname.h:405: warning: cast from pointer to integer of different size
c_sname.h:405: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_first_type’:
c_sname.h:554: warning: cast from pointer to integer of different size
c_sname.h:554: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_local_type’:
c_sname.h:570: warning: cast from pointer to integer of different size
c_sname.h:570: warning: cast to pointer from integer of different size
c_lang.h: In function ‘c_lang_newer’:
c_lang.h:921: warning: passing argument 1 of ‘exactly_one_bit_set’ with different width due to prototype
In file included from c_sname.h:42,
                 from c_ast.h:36,
                 from lexer.l:38:
slist.h: At top level:
slist.h:88: error: redefinition of typedef ‘slist_t’
types.h:58: error: previous declaration of ‘slist_t’ was here
slist.h:89: error: redefinition of typedef ‘slist_node_t’
types.h:59: error: previous declaration of ‘slist_node_t’ was here
In file included from c_ast.h:36,
                 from lexer.l:38:
c_sname.h: In function ‘c_sname_first_type’:
c_sname.h:389: warning: cast from pointer to integer of different size
c_sname.h:389: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_local_type’:
c_sname.h:405: warning: cast from pointer to integer of different size
c_sname.h:405: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_first_type’:
c_sname.h:554: warning: cast from pointer to integer of different size
c_sname.h:554: warning: cast to pointer from integer of different size
c_sname.h: In function ‘c_sname_set_local_type’:
c_sname.h:570: warning: cast from pointer to integer of different size
c_sname.h:570: warning: cast to pointer from integer of different size
c_ast_check.c: In function ‘c_ast_check_visitor’:
c_ast_check.c:215: warning: cast from pointer to integer of different size
c_ast_check.c:215: warning: cast to pointer from integer of different size
c_ast_check.c: In function ‘c_ast_check_alignas’:
c_ast_check.c:289: warning: passing argument 1 of ‘at_most_one_bit_set’ with different width due to prototype
c_ast_check.c: In function ‘c_ast_check_cast’:
c_ast_check.c:505: warning: cast from pointer to integer of different size
c_ast_check.c:505: warning: cast to pointer from integer of different size
make[2]: *** [c_ast.o] Error 1
make[2]: *** Waiting for unfinished jobs....

barracuda156 avatar May 20 '22 01:05 barracuda156

I'd like to fix these warnings, but I don't have access to a 32-bit system to test. Any way I could get an ssh login to such a system?

paul-j-lucas avatar May 20 '22 13:05 paul-j-lucas

@paul-j-lucas Thanks for responding!

Do you want ppc32 or i386? I do not have the latter, but ppc32 is doable. Let me rebuild on ppc32 in order to see if these warning occur.

(Rosetta is a very special case, and it should not use clang for ppc anyway. There is no need to fix that particular case IMO. But you can test Rosetta on 64-bit Intel Mac – that is what I do myself, running 10.6.8 Server in Parallels on Catalina.)

barracuda156 avatar May 21 '22 08:05 barracuda156

I'll take whatever you have access to.

paul-j-lucas avatar May 21 '22 13:05 paul-j-lucas

@paul-j-lucas Here is the complete log: main_10.6_ppc_gcc11.log

Okay, I will find out how to enable ssh access. You need a machine with Macports and gcc11 installed? Or a clean system?

barracuda156 avatar May 21 '22 14:05 barracuda156

I prefer to build for systems that are "native" meaning if it's a macOS 10.6 PPC system, then it should be just with whatever Xcode is the latest supported for that system as supplied by Apple. So if somebody owns such a machine, installs Xcode for it, and builds cdecl, it'll build without errors or warnings.

If somebody goes out of their way to install an ancient version of some non-Apple-provided, perhaps non-C99-standard compiler, and that has errors or warnings, they're on their own.

Thanks for the log, but without a live system to test potential fixes on, it's just shooting in the dark. A much slower alternative is if I create a branch for potential fixes, take my best guesses for fixing them, push to the branch, you pull, try building, report back any remaining errors or warnings. Repeat.

paul-j-lucas avatar May 21 '22 15:05 paul-j-lucas

@paul-j-lucas Thank you. It will make better sense to work with a standard 10.5.8 + Xcode 3.1.4. Give me a couple of days, I will arrange with ssh.

barracuda156 avatar May 21 '22 15:05 barracuda156

@barracuda156: it's been several days. Any update?

paul-j-lucas avatar May 27 '22 01:05 paul-j-lucas

@paul-j-lucas I have just finished setting up the environment to build stuff (I got a new G5 machine for home use). If you can tell me how to enable remote access in a way that is usable for you, I can do it now.

Internet connection set-up is a bit messy: PowerMac is connected over Ethernet to Intel MacMini, MacMini connects to Internet over wifi or from iPhone. I can keep it hooked to wifi for a couple of days so that it is predictably online. I have no control over wifi router though. Access can be given to PowerMac (there is no personal stuff on it, just Macports).

I was advised to use ngrok, but turned out we need to fix go for PPC first in order to use it LOL

barracuda156 avatar May 27 '22 02:05 barracuda156

I need to be able to ssh to it.

paul-j-lucas avatar May 27 '22 13:05 paul-j-lucas

@barracuda156: it's been another week. Any update on ssh access?

paul-j-lucas avatar Jun 02 '22 14:06 paul-j-lucas

@barracuda156: it's been another week. Any update on ssh access?

@paul-j-lucas I apologize for no updates. I initially thought it will be some easy-to-do thing, and mentioned such possibility because I am willing to make it work. However I am no networking experts, and that is why above I asked you for a step-wise procedure: https://github.com/macports/macports-ports/pull/14890#issuecomment-1139221371 Sure enough, I can learn this stuff myself, but that requires time, and I had other priorities with allocating that scarce resource :)

I am away from PPC hardware atm and until the end of month. I did not forget about this matter. I promise to return to it once I am back (or if in the meanwhile somebody of my friends can arrange for the same). How to contact you though? I guess I would not want to share ssh access details publicly?

P. S. I also want to thank you for joining in, we need and appreciate participation of developers.

barracuda156 avatar Jun 10 '22 08:06 barracuda156

@barracuda156: I'm not a networking expert either. On all recent macOS versions, an ssh server has been built-in to the OS — you just have to enable it. In recent macOS versions, that's done via System Preferences > Sharing > Remote Login.

For an older macOS version (which I assume is what's running on PPC hardware), the settings for ssh may be different — you'll just have to look around for it. It should still be called Remote Login, however.

You can either create some random account and send me the login/password; or you can create a pjl account and append my ssh public key to ~pjl/.ssh/authorized_keys. Either way, you can contact me at [email protected].

paul-j-lucas avatar Jun 10 '22 18:06 paul-j-lucas

Any update?

BTW: I've made changed to some casting code. You could just try building the HEAD revision and see if the warnings remain.

paul-j-lucas avatar Jul 08 '22 13:07 paul-j-lucas

Any update? BTW: I’ve made changed to some casting code. You could just try building the HEAD revision and see if the warnings remain.

@paul-j-lucas Thanks, I will try that. I am still travelling (plans changed), but I get to back to PPC hardware by end of August (have to return by then).

barracuda156 avatar Jul 14 '22 18:07 barracuda156

FYI, upstream is now at v14.2, so you'll want to update to that if possible.

mascguy avatar May 24 '23 18:05 mascguy

FYI, upstream is now at v14.2, so you'll want to update to that if possible.

Hey Sergey, in the interest of merging these old backlog PRs, can you prioritize this? There's no segregation, etc... just needs to be updated to latest upstream release.

mascguy avatar May 26 '23 12:05 mascguy

FYI, upstream is now at v14.2, so you'll want to update to that if possible.

Hey Sergey, in the interest of merging these old backlog PRs, can you prioritize this? There's no segregation, etc... just needs to be updated to latest upstream release.

Yes, sure, let me do this now itself.

P. S. Could you take a look at mhxd one, whenever you have time? Also a rather old PR, finally fixed, but I would appreciate someone looking at it. Maybe something can be improved there. (We do not have many Hotline clients around, and just one in Macports, as of now.)

barracuda156 avatar May 26 '23 12:05 barracuda156

@mascguy Updated, rebased, let us see if it builds fine on CI.

Should I squash commits or leave as is?

barracuda156 avatar May 26 '23 13:05 barracuda156

@mascguy Updated, rebased, let us see if it builds fine on CI.

Should I squash commits or leave as is?

I can squash on merge, so don't worry about it.

mascguy avatar May 26 '23 13:05 mascguy

@mascguy Thank you!

I will also deal with libxc tonight. (Wanna sort old PRs out myself, and then I hope to have support with updating GCC – that is a big plan postponed for quite a while.)

barracuda156 avatar May 26 '23 13:05 barracuda156

So did all those warnings go away?

paul-j-lucas avatar May 29 '23 01:05 paul-j-lucas

So did all those warnings go away?

Well, take a look:

https://ports.macports.org/port/cdecl/builds/

There are quite a few sign conversion warnings, among others. Here's an example, for arm64. Though it's relatively consistent, regardless of architecture:

https://build.macports.org/builders/ports-12_arm64-builder/builds/95661/steps/install-port/logs/stdio

mascguy avatar May 29 '23 13:05 mascguy

Those warnings are in GnuLib code, not cdecl's. cdecl's configure.ac tests for and enables several non-default compiler warnings because I want to not have those warnings in my code. Unfortunately, once enabled, all code (including GnuLib code) is compiled with those warnings.

Ideally, I'd want to compile GnuLib code with no additional warnings enabled (code in /lib) and only cdecl code with the warnings enabled (code in /src), but it's not obvious to me how to do that via Autotools since there's only one top-level configure.ac file and only one global CFLAGS.

Suggestions welcome.

paul-j-lucas avatar May 29 '23 13:05 paul-j-lucas

Those warnings are in GnuLib code, not cdecl's. cdecl's configure.ac tests for and enables several non-default compiler warnings because I want to not have those warnings in my code. Unfortunately, once enabled, all code (including GnuLib code) is compiled with those warnings.

Ideally, I'd want to compile GnuLib code with no additional warnings enabled (code in /lib) and only cdecl code with the warnings enabled (code in /src), but it's not obvious to me how to do that via Autotools since there's only one top-level configure.ac file and only one global CFLAGS.

Suggestions welcome.

For us (MacPorts), we typically have no choice but to disable warnings globally. (At least not unless a given upstream project supports more granular control over certain areas. But we generally don't derive much value from trying to take advantage of that anyway, as we're simply trying to reduce the noise.)

Unfortunately my autotools-related knowledge is a bit light, but our more seasoned members might have some ideas.

mascguy avatar May 29 '23 13:05 mascguy

Actually, I think I figured it out. In configure.ac, change:

AX_CFLAGS_WARN_ALL
AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"], [], [-Werror])
AX_CHECK_COMPILE_FLAG([-Wcast-function-type], [CFLAGS="$CFLAGS -Wcast-function-type"], [], [-Werror])
# ...

to:

AC_SUBST(CDECL_CFLAGS)
AX_CFLAGS_WARN_ALL(CDECL_CFLAGS)
AX_CHECK_COMPILE_FLAG([-Wcast-align], [CDECL_CFLAGS="$CDECL_CFLAGS -Wcast-align"], [], [-Werror])
# ...

Then in src/Makefile.am, change:

AM_CFLAGS =

to:

AM_CFLAGS =    $(CDECL_CFLAGS)

and it seems to work. Let me test it a bit more.

paul-j-lucas avatar May 29 '23 14:05 paul-j-lucas