(subject fixed, lang/unicon not iconv!)

On 2025/06/03 15:45, Stuart Henderson wrote:
> lang/icon has this in src/runtime/fmonitr.r, which doesn't work any more
> because profil(2) changed.
> 
>     281 #if UNIX
>     282    /*
>     283     * Call profil(2) to enable program counter profiling.  We use the 
> smallest
>     284     *  allowable scale factor in order to minimize the number of 
> counters;
>     285     *  we assume that the text of iconx does not exceed 256K and so 
> we use
>     286     *  four bins.  One of these four bins will be incremented every 
> system
>     287     *  clock tick (typically 4 to 20 ms).
>     288     *
>     289     *  Take your local profil(2) man page with a grain of salt.  All 
> the systems
>     290     *  we tested really maintain 16-bit counters despite what the man 
> pages say.
>     291     *  Some also say that a scale factor of two maps everything to 
> one counter;
>     292     *  that is believed to be a no-longer-correct statement dating 
> from the days
>     293     *  when the maximum program size was 64K.
>     294     *
>     295     *  The reference to EVInit below just obtains an arbitrary 
> address within
>     296     *  the text segment.
>     297     */
>     298 #ifdef HaveProfil
>     299    profil(ticker.s, sizeof(ticker.s), (int) EVInit & ~0x3FFFF, 2);
>     300 #endif                                  /* HaveProfil*/
>     301 #endif                                  /* UNIX */
> 
> Should I just add a !__OpenBSD__ check, or would you like to do
> something else?
> 

deraadt tells me that the previous profil() won't have worked with
!static binaries since clang anyway, so I'll go ahead with this for now.

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/unicon/Makefile,v
diff -u -p -r1.34 Makefile
--- Makefile    7 Nov 2023 14:19:36 -0000       1.34
+++ Makefile    4 Jun 2025 11:14:06 -0000
@@ -5,7 +5,7 @@ COMMENT=        programming language with gener

 CATEGORIES=    lang
 DISTNAME=      unicon-10.0beta
-REVISION=      3
+REVISION=      4
 DISTFILES=     uni.zip

 FIX_EXTRACT_PERMISSIONS= Yes
Index: patches/patch-src_runtime_fmonitr_r
===================================================================
RCS file: patches/patch-src_runtime_fmonitr_r
diff -N patches/patch-src_runtime_fmonitr_r
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_runtime_fmonitr_r 4 Jun 2025 11:14:06 -0000
@@ -0,0 +1,12 @@
+Index: src/runtime/fmonitr.r
+--- src/runtime/fmonitr.r.orig
++++ src/runtime/fmonitr.r
+@@ -278,7 +278,7 @@ void EVInit()
+     *    in the string region: E_String = string
+     */
+
+-#if UNIX
++#if UNIX && !defined(__OpenBSD__)
+    /*
+     * Call profil(2) to enable program counter profiling.  We use the smallest
+     *  allowable scale factor in order to minimize the number of counters;

Reply via email to