From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#31118: 27.0.50; Can't load/compile websocket in 32bit master Date: Sun, 15 Apr 2018 15:11:50 -0700 Organization: UCLA Computer Science Department Message-ID: <80fbbf82-c20f-6a01-b257-45caa4a87fdf@cs.ucla.edu> References: <6deb652e-7bd1-f003-ac84-0f4c6a18de99@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------4D22D1063BA8914B6A9376E1" X-Trace: blaine.gmane.org 1523830271 1093 195.159.176.226 (15 Apr 2018 22:11:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Apr 2018 22:11:11 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Cc: 31118@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 16 00:11:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7prW-0000AJ-VE for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Apr 2018 00:11:07 +0200 Original-Received: from localhost ([::1]:47177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7ptd-00086e-Lb for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Apr 2018 18:13:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f7ptT-000844-NZ for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2018 18:13:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f7ptP-0005Im-I0 for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2018 18:13:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f7ptP-0005Ii-7T for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2018 18:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f7ptO-0003R8-Vd for bug-gnu-emacs@gnu.org; Sun, 15 Apr 2018 18:13:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Apr 2018 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31118 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31118-submit@debbugs.gnu.org id=B31118.152383032613111 (code B ref 31118); Sun, 15 Apr 2018 22:13:02 +0000 Original-Received: (at 31118) by debbugs.gnu.org; 15 Apr 2018 22:12:06 +0000 Original-Received: from localhost ([127.0.0.1]:54673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7psU-0003PO-BA for submit@debbugs.gnu.org; Sun, 15 Apr 2018 18:12:06 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f7psQ-0003Oq-QU for 31118@debbugs.gnu.org; Sun, 15 Apr 2018 18:12:03 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F2641161291; Sun, 15 Apr 2018 15:11:56 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id teh2QQCSVSuI; Sun, 15 Apr 2018 15:11:55 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D69CA161684; Sun, 15 Apr 2018 15:11:55 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XXtN1sHw55bD; Sun, 15 Apr 2018 15:11:55 -0700 (PDT) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B303D161291; Sun, 15 Apr 2018 15:11:55 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145419 Archived-At: This is a multi-part message in MIME format. --------------4D22D1063BA8914B6A9376E1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Although I still can't build ELPA (see Bug#31118#31), I took a shot at making ELPA build for 32-bit Emacs on master by installing the attached patches into the xelb and exwm packages, respectively. As I understand it, some parts of ELPA still assume 64-bit Emacs, but that's lower priority as it's not a regression. Also, one still cannot reliably build ELPA on 64-bit Emacs and run it on 32-bit Emacs (or vice versa), but people don't do that much and I suspect it wasn't really working either. --------------4D22D1063BA8914B6A9376E1 Content-Type: text/x-patch; name="0001-Port-to-32-bit-Emacs-master.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-to-32-bit-Emacs-master.patch" >From 0a46cc62a3a82dcaa1d1bf0929a5207260f635e3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 15 Apr 2018 15:00:09 -0700 Subject: [PATCH] Port to 32-bit Emacs master Rewrite #xFFFFFFFF to 4294967295. and similarly for other hex constants intended to be floating-point on 32-bit Emacs. * el_client.el (xelb-parse-enum): Omit enums that do not fit in 32-bit Emacs. * xcb-xinput.el (xcb:xinput:ModifierMask:Any): * xcb-xkb.el (xcb:xkb:Control:IgnoreLockMods) (xcb:xkb:Control:PerKeyRepeat, xcb:xkb:Control:ControlsEnabled): Remove. --- el_client.el | 8 +++++++- xcb-cursor.el | 2 +- xcb-icccm.el | 2 +- xcb-types.el | 28 ++++++++++++++-------------- xcb-xinput.el | 2 -- xcb-xkb.el | 3 --- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/el_client.el b/el_client.el index 9b7077f98..393745ef0 100644 --- a/el_client.el +++ b/el_client.el @@ -351,7 +351,13 @@ an `xelb-auto-padding' attribute." (if expression (setq value (xelb-parse-expression expression)) (setq value (1+ value))) - `(defconst ,name ,value)))) + ;; Omit the rare enums that do not fit in a fixnum in + ;; 32-bit Emacs, so that the resulting .el and .elc + ;; files are portable to 32-bit Emacs. Admittedly + ;; this is a kludge. + (unless (and ((integerp value) + (not (<= -536870912 value 536870911)))) + `(defconst ,name ,value))))) items)))) (defun xelb-parse-typedef (node) diff --git a/xcb-cursor.el b/xcb-cursor.el index 12bbf27ac..71842a383 100644 --- a/xcb-cursor.el +++ b/xcb-cursor.el @@ -230,7 +230,7 @@ (defconst xcb:cursor:-file-chunk-image-header 36 "Header value of image-type chunk in Xcursor file.") -(defconst xcb:cursor:-file-chunk-image-type #xFFFD0002 +(defconst xcb:cursor:-file-chunk-image-type 4294770690. "Type of image-type chunk in Xcursor file.") (defconst xcb:cursor:-file-chunk-image-version 1 "Version of image-type chunk in Xcursor file.") diff --git a/xcb-icccm.el b/xcb-icccm.el index 613bed187..4599a7dbf 100644 --- a/xcb-icccm.el +++ b/xcb-icccm.el @@ -119,7 +119,7 @@ A valid timestamp (rather than `xcb:Time:CurrentTime') must be supplied.") (defclass xcb:icccm:-GetProperty (xcb:GetProperty) ((delete :initform 0) (long-offset :initform 0) - (long-length :initform 1000000000)) ;as long as possible + (long-length :initform 1000000000.)) ;as long as possible :documentation "Get an ICCCM property (request part).") (defclass xcb:icccm:-GetProperty~reply (xcb:GetProperty~reply) diff --git a/xcb-types.el b/xcb-types.el index f5c1a3c13..0c172b64d 100644 --- a/xcb-types.el +++ b/xcb-types.el @@ -155,8 +155,8 @@ (logand (lsh value -16) #xFF) (logand (lsh value -8) #xFF) (logand value #xFF)) - (let* ((msdw (min #xFFFFFFFF (truncate value #x100000000))) - (lsdw (min #xFFFFFFFF + (let* ((msdw (min 4294967295. (truncate value 4294967296.))) + (lsdw (min 4294967295. (truncate (- value (* msdw 4294967296.0)))))) (vector (logand (lsh msdw -24) #xFF) (logand (lsh msdw -16) #xFF) (logand (lsh msdw -8) #xFF) (logand msdw #xFF) @@ -173,8 +173,8 @@ (logand (lsh value -40) #xFF) (logand (lsh value -48) #xFF) (logand (lsh value -56) #xFF)) - (let* ((msdw (min #xFFFFFFFF (truncate value #x100000000))) - (lsdw (min #xFFFFFFFF + (let* ((msdw (min 4294967295. (truncate value 4294967296.))) + (lsdw (min 4294967295. (truncate (- value (* msdw 4294967296.0)))))) (vector (logand lsdw #xFF) (logand (lsh lsdw -8) #xFF) (logand (lsh lsdw -16) #xFF) (logand (lsh lsdw -24) #xFF) @@ -207,11 +207,11 @@ (vector 0 0 0 0 (logand (lsh value -24) #xFF) (logand (lsh value -16) #xFF) (logand (lsh value -8) #xFF) (logand value #xFF)) - (let* ((msw (min #xFFFF (truncate value #x1000000000000))) + (let* ((msw (min #xFFFF (truncate value 281474976710656.))) (w1 (min #xFFFF (truncate (setq value (- value (* msw 281474976710656.0))) - #x100000000))) + 4294967296.))) (w2 (min #xFFFF (truncate (setq value (- value (* w1 4294967296.0))) #x10000))) @@ -226,11 +226,11 @@ (vector (logand value #xFF) (logand (lsh value -8) #xFF) (logand (lsh value -16) #xFF) (logand (lsh value -24) #xFF) 0 0 0 0) - (let* ((msw (min #xFFFF (truncate value #x1000000000000))) + (let* ((msw (min #xFFFF (truncate value 281474976710656.))) (w1 (min #xFFFF (truncate (setq value (- value (* msw 281474976710656.0))) - #x100000000))) + 4294967296.))) (w2 (min #xFFFF (truncate (setq value (- value (* w1 4294967296.0))) #x10000))) @@ -244,13 +244,13 @@ "4 bytes signed integer => byte array (MSB first)." (xcb:-pack-u4 (if (>= value 0) value - (+ value #x100000000)))) ;treated as float for 32-bit + (+ value 4294967296.)))) ;treated as float for 32-bit (defsubst xcb:-pack-i4-lsb (value) "4 bytes signed integer => byte array (LSB first)." (xcb:-pack-u4-lsb (if (>= value 0) value - (+ value #x100000000)))) ;treated as float for 32-bit + (+ value 4294967296.)))) ;treated as float for 32-bit (defsubst xcb:-unpack-u1 (data offset) "Byte array => 1 byte unsigned integer." @@ -361,16 +361,16 @@ (defsubst xcb:-unpack-i4 (data offset) "Byte array => 4 bytes signed integer (MSB first)." (let ((value (xcb:-unpack-u4 data offset))) - (if (< value #x80000000) ;treated as float for 32-bit + (if (< value 2147483648.) ;treated as float for 32-bit value - (- value #x100000000)))) ;treated as float for 32-bit + (- value 4294967296.)))) ;treated as float for 32-bit (defsubst xcb:-unpack-i4-lsb (data offset) "Byte array => 4 bytes signed integer (LSB first)." (let ((value (xcb:-unpack-u4-lsb data offset))) - (if (< value #x80000000) ;treated as float for 32-bit + (if (< value 2147483648.) ;treated as float for 32-bit value - (- value #x100000000)))) ;treated as float for 32-bit + (- value 4294967296.)))) ;treated as float for 32-bit (defmacro xcb:-fieldref (field) "Evaluate a field." diff --git a/xcb-xinput.el b/xcb-xinput.el index b2ef72b8c..f4da64e37 100644 --- a/xcb-xinput.el +++ b/xcb-xinput.el @@ -1862,8 +1862,6 @@ (defconst xcb:xinput:GrabType:FocusIn 3) (defconst xcb:xinput:GrabType:TouchBegin 4) -(defconst xcb:xinput:ModifierMask:Any 2147483648) - (defclass xcb:xinput:GrabModifierInfo (xcb:-struct) ((modifiers :initarg :modifiers :type xcb:CARD32) diff --git a/xcb-xkb.el b/xcb-xkb.el index 881f4df0f..1f26deb68 100644 --- a/xcb-xkb.el +++ b/xcb-xkb.el @@ -105,9 +105,6 @@ (defconst xcb:xkb:Control:GroupsWrap 134217728) (defconst xcb:xkb:Control:InternalMods 268435456) -(defconst xcb:xkb:Control:IgnoreLockMods 536870912) -(defconst xcb:xkb:Control:PerKeyRepeat 1073741824) -(defconst xcb:xkb:Control:ControlsEnabled 2147483648) (defconst xcb:xkb:AXOption:SKPressFB 1) (defconst xcb:xkb:AXOption:SKAcceptFB 2) -- 2.14.3 --------------4D22D1063BA8914B6A9376E1 Content-Type: text/x-patch; name="0001-Port-to-32-bit-Emacs-on-master-branch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-to-32-bit-Emacs-on-master-branch.patch" >From ff4ae82fd7ca9101da92f21c7f46f991da99a30e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 15 Apr 2018 14:52:39 -0700 Subject: [PATCH] Port to 32-bit Emacs on master branch --- exwm-layout.el | 2 +- exwm.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exwm-layout.el b/exwm-layout.el index b74f512a4..764259870 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -117,7 +117,7 @@ (with-current-buffer (exwm--id->buffer id) (unless (or (exwm-layout--iconic-state-p) (and exwm--floating-frame - (eq #xffffffff exwm--desktop))) + (eq 4294967295. exwm--desktop))) (exwm--log "Hide #x%x" id) (when exwm--floating-frame (let* ((container (frame-parameter exwm--floating-frame diff --git a/exwm.el b/exwm.el index 195ca7b80..17f73d8ca 100644 --- a/exwm.el +++ b/exwm.el @@ -154,7 +154,7 @@ (when reply (setq desktop (slot-value reply 'value)) (cond - ((eq desktop #xffffffff) + ((eq desktop 4294967295.) (unless (or (not exwm--floating-frame) (eq exwm--frame exwm-workspace--current) (and exwm--desktop -- 2.14.3 --------------4D22D1063BA8914B6A9376E1--