Bug 115217

Summary: Ada devel/florist socket program doesn't compile due to internal error
Product: Ports & Packages Reporter: Douglas Wells <sysmaint>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: sysmaint
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Douglas Wells 2007-08-05 15:10:01 UTC
	A simple Ada program using devel/florist to access POSIX
	sockets encounters the error:

		posix-sockets-internet.gpb:660:15: duplication of choice value at line 659
		posix-sockets-internet.gpb:674:15: duplication of choice value at line 673
		gnatmake: "/usr/local/lib/florist/posix-sockets-internet.adb" compilation error

	Note that posix-sockets-internet is internal to florist.

Fix: 

The problem seems to arise from a case statement that has
	duplicate selectors based on the IP type-of-server IPTOS_*
	values, each of which has the value 0.  This problem in turn
	is caused by a questionable tactic in the internal translation
	code in c-posix.c, which provides a default value of 0 for
	any C define that it is unable to locate.

	The problem here is that the translation process does not have
	access to the include file <netinet/ip.h>.  A workaround is to
	patch pconfig.h (after make config) to define near the top:
		#define __BSD_VISIBLE   1
	and to include near the other netinet includes:
		#include <netinet/ip.h>

	With this change the test program and several other more
	complicated programs compile and execute properly.  This
	problem may or may not be more cleanly resolved via
	appropriate changes to the configure mechanism.
How-To-Repeat: 	Use the command:
		gnatmake -I/usr/local/lib/florist px_socket.adb
	with this test program:
	------------------------- px_socket.adb -------------------
	with POSIX.Sockets;
	with POSIX.Sockets.Internet;

	procedure px_socket is
		package PS renames POSIX.Sockets;
		package PSI renames POSIX.Sockets.Internet;

		sockfamily : PS.Protocol_Family := PSI.Internet_Protocol;
	begin
		null;
	end px_socket;
	----------------------- end px_socket.adb -----------------
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-08-05 17:31:41 UTC
State Changed
From-To: open->closed

Duplicate of ports/115216.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2007-08-05 23:35:19 UTC
State Changed
From-To: closed->open

reopen on submitters request.
Comment 3 Alejandro Pulver freebsd_committer freebsd_triage 2007-09-30 21:24:58 UTC
Responsible Changed
From-To: freebsd-ports-bugs->alepulver

I'll take it.
Comment 4 Alejandro Pulver freebsd_committer freebsd_triage 2007-09-30 23:49:58 UTC
State Changed
From-To: open->suspended

The
Comment 5 Alejandro Pulver freebsd_committer freebsd_triage 2007-09-30 23:58:31 UTC
State Changed
From-To: suspended->open

Ops, wrong message (quotes removed by 'ssh').
Comment 6 Alejandro Pulver freebsd_committer freebsd_triage 2007-09-30 23:58:48 UTC
State Changed
From-To: open->suspended

The lang/gnat distfiles have been replaced by new ones, wait for a port 
update.
Comment 7 Alejandro Pulver freebsd_committer freebsd_triage 2007-10-21 18:58:42 UTC
Responsible Changed
From-To: alepulver->freebsd-ports-bugs

Leave PR (no time; if the required port is updated or there is a mirror 
somewhere, let me know and I will handle it).
Comment 8 Felippe de Meirelles Motta freebsd_committer freebsd_triage 2008-06-06 06:38:03 UTC
Hi Submitter,

After last updates on this port, can you confirm us if that problem was
solved?

Thanks for your contribution to the FreeBSD Project! :)

-- 
lippe@FreeBSD.org
Felippe de Meirelles Motta
Comment 9 Douglas Wells 2008-06-13 15:43:38 UTC
> Hi Submitter,
> 
> After last updates on this port, can you confirm us if that problem was
> solved?
> 
> Thanks for your contribution to the FreeBSD Project! :)
> 
> -- 
> lippe@FreeBSD.org
> Felippe de Meirelles Motta

I don't understand what updates have been made to the devel/florist
port (I am still using gnat-3.15p_1).  Nonetheless, in response
to a similar inquiry last September, I made the following reply:

% In any case, I should note that I just reran the bug tests and a
% least the simpler programs (px_true and px_false) now work.  I
% don't quite see what the difference is, but since I filed the bug
% the lang/gnat-gcc34 port has been eliminated, and I have installed
% lang/gnat-gcc42 port in parallel with lang/gnat.  It looks to me
% as though the two gnat ports ought to be able to coexist without
% interference but clearly something is different.

I have just reverified that the test programs still work.  (That
is, the test program that failed when I originally submitted it
was working properly last September and continues to work properly
today.)

I continue to be mystified about what actually changed in the
FreeBSD system to actually fix the problem.

But, in summary, the problem has been solved and the bug report
can be closed.

 - dmw
Comment 10 Felippe de Meirelles Motta freebsd_committer freebsd_triage 2008-06-13 23:26:41 UTC
State Changed
From-To: suspended->closed

Problem solved, according submitter!