Bug 254852 - lang/sdcc does not compile and install libs for pic14-port
Summary: lang/sdcc does not compile and install libs for pic14-port
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-04-07 12:02 UTC by pererikrunebert95
Modified: 2021-04-10 08:46 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (darius)

patches for Makefile and pkg-plist (3.50 KB, application/x-tar)
2021-04-07 12:02 UTC, pererikrunebert95
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pererikrunebert95 2021-04-07 12:02:39 UTC
Created attachment 223895 [details]
patches for Makefile and pkg-plist

After installing sdcc from package and trying to compile a .c-testfile for PIC16F84a I get the error 'libsdcc.lib missing'.

When trying the port lang/sdcc I found an error when compiling pic14-port part. The pic16-port is Ok.

I have found a missing line in lang/sdcc/Makefile that makes it compile all libs except libsdcce.lib (enhanced). Have not found out why libsdcce.lib still is missing...

The relevant lines in pkg-plist for the compiled pic14-port libs are also missing.

After manual copy of the missing libs to /usr/local/share/sdcc/lib/pic14 the testfile compiled Ok.

My host: 12.2-RELEASE-p4 GENERIC  amd64
sdcc version: sdcc-4.0.0_1

Patches included.

Additional Information:
Have tested an ARCH Linux sdcc package (same version) and it has all pic14-port libs, including the 'libsdcce.lib' and testfile compiled Ok.
Comment 1 darius 2021-04-08 12:56:56 UTC
I tried a build with your patches and builds & installs for me - I don't have any PIC code to test on so I'll take your word it works :)

I'm not sure about libsdcce.a - the auto*/configure stuff is very complicated so I am not sure what the problem is.

Do you think you could chase it up on an SDCC mailing list?
Comment 2 pererikrunebert95 2021-04-09 15:34:37 UTC
There are tests for all functions in all ports in directory support/regression.
To run:
'cd support/regression' and
'gmake' run all tests for all ports. (takes looooooong time to run)
'gmake test-pic14' only tests pic14-port. I did that. (takes looong time)
'touch tests/<test-case>.c; gmake [test-<target>]' re-execute single test case.
More info at https://sourceforge.net/p/sdcc/wiki/Regression%20Testing/

The tests I have run for pic14-port require at least gmake,gputils,gpsim and python.
On my desktop there is only python with version in commandname so I had to make a link from 'python3.6' to 'python'. Sadly, of 6488 tests there were 281 failures and 31 abnormal stop.

Some tests fail with coredump of gplink and some with sim-timeout of gpsim.

I have not dig into these errors. Im currently trying to locate the problems with libsdcce.lib.
Comment 3 pererikrunebert95 2021-04-09 17:29:11 UTC
I have found the cause for not building libsdcce.lib. When I edit the file /device/lib/pic14/libsdcc/enhanced/Makefile and set back PICARCH to ARCH and then
removed .../work/.stage_done.sdcc._usr_local the compilation and installation into stage directory worked Ok.
So the obvious problem lies in the lang/sdcc/Makefile that change all occurrences of ARCH to PICARCH.

I am not that familiar with package setup so I am not the person to alter the package to solve this, just to point in the right direction.

In the gplink and gpsim problems I will do some digging.
Comment 4 pererikrunebert95 2021-04-10 08:46:15 UTC
I am afraid that the problems with gplink and gpsim have to be solved in the source code. When I tested the source on a Arch Linux I got the same errors.

The forum states that pic14 and pic16 currently is unmaintained.