Patch needed for new libcontext and FreeBSD

Bug #1671083 reported by Foo Barmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Maciej Suminski

Bug Description

Hi,
I need the following patch to get the new libcontext stuff compiled under FreeBSD:

--- include/system/libcontext.h.orig 2017-03-08 13:29:09.028153000 +0100
+++ include/system/libcontext.h 2017-03-08 13:31:22.843111000 +0100
@@ -23,5 +23,5 @@

-#if defined(__GNUC__) || defined(__APPLE__)
+#if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)

     #define LIBCONTEXT_COMPILER_gcc
@@ -55,5 +55,5 @@
            #define LIBCONTEXT_CALL_CONVENTION __cdecl
        #endif
- #elif defined(__APPLE__) && defined(__MACH__)
+ #elif defined(__APPLE__) && defined(__MACH__) || defined(__FreeBSD__)
        #if defined (__i386__)
            #define LIBCONTEXT_PLATFORM_apple_i386
@@ -62,4 +62,7 @@
            #define LIBCONTEXT_PLATFORM_apple_x86_64
            #define LIBCONTEXT_CALL_CONVENTION
+ #elif defined (__amd64__)
+ #define LIBCONTEXT_PLATFORM_apple_x86_64
+ #define LIBCONTEXT_CALL_CONVENTION
        #endif
     #endif

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Thank you.

After building with this patch applied, have you tested pcbnew to verify that it works? In particular, can you switch between and use tools while the OpenGL or Cairo canvas is active?

Revision history for this message
Foo Barmann (foo-barmann) wrote :

Hi,
before I can test this change, I need to get kicad fully compiled which fails due to an unrelated change:
https://bugs.launchpad.net/kicad/+bug/1671086

After getting the whole thing compiled we can test the runtime behaviour...

Revision history for this message
Foo Barmann (foo-barmann) wrote :

Hi,
after kicad compiled again I could test the patch above (which compiled cleanly but didn't work).
The following patch compiles and works:

--- include/system/libcontext.h.orig 2017-03-13 11:47:23.495919000 +0100
+++ include/system/libcontext.h 2017-03-13 11:51:12.678651000 +0100
@@ -23,13 +23,15 @@

-#if defined(__GNUC__) || defined(__APPLE__)
+#if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)

     #define LIBCONTEXT_COMPILER_gcc

- #if defined(__linux__)
+ #if defined(__linux__) || defined(__FreeBSD__)
        #ifdef __x86_64__
            #define LIBCONTEXT_PLATFORM_linux_x86_64
            #define LIBCONTEXT_CALL_CONVENTION
-
+ #elif __amd64
+ #define LIBCONTEXT_PLATFORM_linux_x86_64
+ #define LIBCONTEXT_CALL_CONVENTION
        #elif __i386__
            #define LIBCONTEXT_PLATFORM_linux_i386

Revision history for this message
Foo Barmann (foo-barmann) wrote :

Hi,
__amd64__ missed two characters, here is a corrected patch:
--- include/system/libcontext.h.orig 2017-03-13 11:47:23.495919000 +0100
+++ include/system/libcontext.h 2017-03-13 11:51:12.678651000 +0100
@@ -23,13 +23,15 @@

-#if defined(__GNUC__) || defined(__APPLE__)
+#if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)

     #define LIBCONTEXT_COMPILER_gcc

- #if defined(__linux__)
+ #if defined(__linux__) || defined(__FreeBSD__)
        #ifdef __x86_64__
            #define LIBCONTEXT_PLATFORM_linux_x86_64
            #define LIBCONTEXT_CALL_CONVENTION
-
+ #elif __amd64__
+ #define LIBCONTEXT_PLATFORM_linux_x86_64
+ #define LIBCONTEXT_CALL_CONVENTION
        #elif __i386__
            #define LIBCONTEXT_PLATFORM_linux_i386

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Committed in 679074fd

Changed in kicad:
status: New → Fix Committed
Revision history for this message
Mike (u20150417) wrote :

Hi,
could it be that the FreeBSD part of the patch got lost during commit?

I still need the following to get kicad compiled for FreeBSD:

---- include/system/libcontext.h.orig 2017-03-13 11:47:23.495919000 +0100
-+++ include/system/libcontext.h 2017-03-13 11:51:12.678651000 +0100
-@@ -23,13 +23,15 @@
-
-
--#if defined(__GNUC__) || defined(__APPLE__)
-+#if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)
-
- #define LIBCONTEXT_COMPILER_gcc
-
-- #if defined(__linux__)
-+ #if defined(__linux__) || defined(__FreeBSD__)
- #ifdef __x86_64__
- #define LIBCONTEXT_PLATFORM_linux_x86_64
- #define LIBCONTEXT_CALL_CONVENTION
--
-+ #elif __amd64__
-+ #define LIBCONTEXT_PLATFORM_linux_x86_64
-+ #define LIBCONTEXT_CALL_CONVENTION
- #elif __i386__
- #define LIBCONTEXT_PLATFORM_linux_i386

Greetings
---
Mike

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

As above, the patch got mangled! Still broken.

Changed in kicad:
status: Fix Committed → Confirmed
assignee: nobody → Maciej Sumiński (orsonmmz)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 2206d51b82ab1353b33e78a18ebc4d6970ff05db
https://git.launchpad.net/kicad/patch/?id=2206d51b82ab1353b33e78a18ebc4d6970ff05db

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Right, I lost the patch while introducing other changes. I apologize for the mistake, it should be fine now.

Revision history for this message
Foo Barmann (foo-barmann) wrote : Re: [Bug 1671083] Re: Patch needed for new libcontext and FreeBSD

Hi,
thanks alot for fixing!

Greetings
---
Mike

Am 28. Juli 2017 16:04:53 MESZ schrieb "Maciej Sumiński" <email address hidden>:
>Right, I lost the patch while introducing other changes. I apologize
>for
>the mistake, it should be fine now.
>
>--
>You received this bug notification because you are subscribed to the
>bug
>report.
>https://bugs.launchpad.net/bugs/1671083
>
>Title:
> Patch needed for new libcontext and FreeBSD
>
>Status in KiCad:
> Fix Committed
>
>Bug description:
> Hi,
>I need the following patch to get the new libcontext stuff compiled
>under FreeBSD:
>
>--- include/system/libcontext.h.orig 2017-03-08 13:29:09.028153000
>+0100
> +++ include/system/libcontext.h 2017-03-08 13:31:22.843111000 +0100
> @@ -23,5 +23,5 @@
>
>
> -#if defined(__GNUC__) || defined(__APPLE__)
> +#if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)
>
> #define LIBCONTEXT_COMPILER_gcc
> @@ -55,5 +55,5 @@
> #define LIBCONTEXT_CALL_CONVENTION __cdecl
> #endif
> - #elif defined(__APPLE__) && defined(__MACH__)
>+ #elif defined(__APPLE__) && defined(__MACH__) ||
>defined(__FreeBSD__)
> #if defined (__i386__)
> #define LIBCONTEXT_PLATFORM_apple_i386
> @@ -62,4 +62,7 @@
> #define LIBCONTEXT_PLATFORM_apple_x86_64
> #define LIBCONTEXT_CALL_CONVENTION
> + #elif defined (__amd64__)
> + #define LIBCONTEXT_PLATFORM_apple_x86_64
> + #define LIBCONTEXT_CALL_CONVENTION
> #endif
> #endif
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/kicad/+bug/1671083/+subscriptions

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.