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: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Joseph Mingrone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-07 12:02 UTC by pererikrunebert95
Modified: 2021-05-10 02:56 UTC (History)
3 users (show)

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


Attachments
patches for Makefile and pkg-plist (3.50 KB, application/x-tar)
2021-04-07 12:02 UTC, pererikrunebert95
no flags Details
Updated patch (1.36 KB, patch)
2021-05-10 02:22 UTC, Daniel O'Connor
no flags Details | Diff

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 Daniel O'Connor 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.
Comment 5 Daniel O'Connor 2021-05-10 01:18:56 UTC
OK, given it's an upstream problem I guess not much can be done.

I think the patch you created can be committed as is, as I have tested it.
I'll try and find a ports committer to do that.
Comment 6 Daniel O'Connor 2021-05-10 02:22:44 UTC
Created attachment 224801 [details]
Updated patch
Comment 7 Daniel O'Connor 2021-05-10 02:23:32 UTC
(In reply to darius from comment #6)
Oops, I forgot I'd had to modify your patch to install without warning.

The attached patch passes stage-qa and bumps PORTREVISION.
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-05-10 02:56:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=df586078d6966c77829ee2584854c250988129ef

commit df586078d6966c77829ee2584854c250988129ef
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2021-05-10 01:54:32 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2021-05-10 02:55:36 +0000

    lang/sdcc: Fix compilation issue and install libaries for pic14-port

    PR:             254852
    Approved by:    darius@dons.net.au (maintainer)

    Co-authored-by: darius@dons.net.au
    Co-authored-by: pererikrunebert95@gmail.com

 lang/sdcc/Makefile  | 3 ++-
 lang/sdcc/pkg-plist | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 9 Joseph Mingrone freebsd_committer freebsd_triage 2021-05-10 02:56:44 UTC
Committed.  Thanks for submitting.