Opened 2 weeks ago

Last modified 10 days ago

#70889 assigned defect

oath-toolkit @2.6.7: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Reported by: laughingtiger Owned by: fracai
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: arm64 sequoia Cc: laughingtiger
Port: oath-toolkit

Description

The OS is running on a M2 mac mini under UTM VM updated from Sequoia beta to 15.0 release. Ran latest Sequoia Macports installer and installed large number of ports without issue. xcode-select is latest version. Cleaned failed install of oath-toolkit and ran rm -rf /Library/Developer/CommandLineTools/usr/include/c++ Second attempted install also failed.

Attachments (4)

main.log (565.4 KB) - added by laughingtiger 2 weeks ago.
include_stdlib.diff (708 bytes) - added by calebstein1 (Caleb Stein) 2 weeks ago.
patch-2.6.11-include-stdlib.diff (478 bytes) - added by amolinas 2 weeks ago.
Portfile (2.4 KB) - added by amolinas 2 weeks ago.

Download all attachments as: .zip

Change History (10)

Changed 2 weeks ago by laughingtiger

Attachment: main.log added

comment:1 Changed 2 weeks ago by laughingtiger

Cc: laughingtiger added

comment:2 Changed 2 weeks ago by jmroot (Joshua Root)

Cc: arno+macports@… fracai removed
Keywords: arm64 sequoia added; arm-64 Sequoia removed
Owner: set to fracai
Status: newassigned
:info:build container.c:160:9: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build   160 |   tmp = realloc (container->keypackages,
:info:build       |         ^
:info:build container.c:160:9: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc'

Changed 2 weeks ago by calebstein1 (Caleb Stein)

Attachment: include_stdlib.diff added

comment:3 Changed 2 weeks ago by calebstein1 (Caleb Stein)

I was able to build on 15.0 using the patch I've attached. I'm not too familiar with the structure of upstream, so I'd rather someone with more familiarity there confirm whether adding these includes is actually safe or a good idea, but at least on my end this allows the build to succeed now.

comment:4 Changed 2 weeks ago by ryandesign (Ryan Carsten Schmidt)

Summary: oath-toolkit fails to build on Sequoia 15.0 on M2 Mac minioath-toolkit @2.6.7: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

In version 2.6.11, two of the three files you're patching already include stdlib.h. Let's start by trying to update the port to that version, adding the patch for the remaining file if it's needed.

comment:5 Changed 2 weeks ago by amolinas

Confirmed that it works with version 2.6.11 and applying the attached patch (patch-2.6.11-include-stdlib.diff). The difference with the previous submitted patch, apart from patching only global.c, is that stdlib.h is included after config.h (required). I also include my Portfile as a reference. It can contain obvious errors, as I just hacked it quickly.

Last edited 2 weeks ago by amolinas (previous) (diff)

Changed 2 weeks ago by amolinas

Changed 2 weeks ago by amolinas

Attachment: Portfile added

comment:6 Changed 10 days ago by ksbeattie (Keith Beattie)

I too can confirm that using the attached Portfile and patch-2.6.11-include-stdlib.diff files, this is now working.

Note: See TracTickets for help on using tickets.