MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

sdcc: Added 4.5.0

Open jhol opened this issue 1 month ago • 7 comments

This PR depends up #26578 first begin merged.

jhol avatar Dec 06 '25 00:12 jhol

Ok, the build is finally fixed!

jhol avatar Dec 08 '25 23:12 jhol

I'm feeding back the various issues to the developers here: https://sourceforge.net/p/sdcc/mailman/sdcc-devel/thread/1523c791c8ca91e0c642466d76ec8ec8%40airwebreathe.org.uk/#msg59270426

jhol avatar Dec 08 '25 23:12 jhol

@jhol The following patch resolves the issue caused by #define B. The root cause is that a compilation error occurs if #define B appears before including winsock2.h, but not if it appears after. Testing shows that including windef.h before #define B prevents the compilation error. This patch includes cmdutil.h earlier in the file. Since cmdutil.h includes winsock2.h, it eliminates the issue related to #define B.

Index: sim/ucsim/src/sims/s51.src/port.cc
===================================================================
diff --git a/sim/ucsim/src/sims/s51.src/port.cc b/sim/ucsim/src/sims/s51.src/port.cc
--- a/sim/ucsim/src/sims/s51.src/port.cc	(revision 15954)
+++ b/sim/ucsim/src/sims/s51.src/port.cc	(working copy)
@@ -30,6 +30,7 @@
 
 // cmd
 #include "argcl.h"
+#include "cmdutil.h"
 
 // local
 #include "regs51.h"

Additionally, I tested that sdcc can be compiled under clang64. build with clang need avoid ada check

  declare -a _extra_config
  if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
    # Checking for a working Ada compiler takes very long and ultimately fails.
    _extra_config+=("acx_cv_cc_gcc_supports_ada=no")
  fi

  "../${_realname}-${pkgver}/configure" \
    --prefix=${MINGW_PREFIX} \
    --includedir=${MINGW_PREFIX}/include/sdcc \
    --disable-werror \
    ${_extra_config[@]} \
    sdccconf_h_dir_separator=\\\\

SquallATF avatar Dec 12 '25 13:12 SquallATF

add treedec for sdcc #26852

SquallATF avatar Dec 12 '25 14:12 SquallATF

Here is a v2 of the patch-set with @SquallATF 's suggestions:

  • Fixes build issues with ucsim using the far simpler approach proposed by @SquallATF .
  • Adds support for clang64 build.
    • clangarm64 isn't supported for now until aarch64-w64-mingw32 support is added to support/sdbinutils/bfd/config.bfd. Support for this platform was added in binutils 16fea92ccd99, which was released v2.41. clangarm64 support can be added once SDCC integrates this.

jhol avatar Dec 12 '25 20:12 jhol

Here is v3 of the patch-set with a dependency on the treedec package added. ~~The CI system build will fail until the mingw-w64-treedec package has been built and uploaded, but~~ it has been tested locally. The SDCC configure script gives the following output:

checking for treedec/combinations.hpp... yes

jhol avatar Dec 15 '25 17:12 jhol

Here is v4 of the patch which makes the following changes:

  • Set SDCC license to SPDX identifier
  • Set msys2_documentation_url, msys2_repository_url and msys2_references.

jhol avatar Dec 15 '25 18:12 jhol

is it ready now?

ognevny avatar Dec 22 '25 06:12 ognevny

Here is v5 of the patch which makes the following changes:

  • Address @ognevny 's review comments.
  • Rebase on master

jhol avatar Dec 22 '25 17:12 jhol

is it ready now?

I think so. There's no more changes planned from my side.

jhol avatar Dec 22 '25 17:12 jhol